Understand repositories and commits
Learn what Git tracks and how commits preserve project snapshots.
- Explain the difference between a Git repository, a working tree and a commit.
Git is a version control system. A repository stores project history and metadata; the working tree is the set of files you are editing. A commit records a snapshot and points to its parent commit, forming a history you can inspect and share.
git init
git status
git log --onelineInitialized repository On branch main Nothing to commit yet No commits yet
Git can work without a network connection. GitHub and similar services host repositories and add collaboration features, but they are separate products rather than part of Git itself.
Key takeaways
A repository contains project history; the working tree contains your current files.
Commits are snapshots linked into history.
Git is a local version control tool; GitHub is a hosting and collaboration service.
Lesson quiz
5 questions · pass with 4 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…