What is Git?
Git is a distributed version control system that tracks changes to your code over time.
Why Use Git?
- Track Changes: See what changed, when, and by whom
- Collaboration: Work with others without overwriting code
- Backup: Your code history is always saved
- Branching: Work on features in isolation
- Undo Mistakes: Easily revert to previous versions
Key Concepts
Repository (Repo)
A repository is a folder that Git tracks. It contains all your project files and the complete history of changes.
Commit
A commit is a snapshot of your project at a specific point in time. Each commit has:
- A unique hash (ID)
- A message describing the change
- The author and timestamp
- A pointer to the previous commit
Branch
A branch is an independent line of development. The default branch is usually called main or master.
Try the Git Terminal
Practice Git commands in this interactive terminal:
Common Commands Overview
| Command | Description |
|---|---|
git status | Show current state |
git add | Stage changes |
git commit | Save changes |
git log | View history |
git branch | Manage branches |
Exercise: Run Your First Commands
Try running git status and git log --oneline:

