What is Git?
Git is a distributed version control system — it tracks every change you make to your code, lets you go back in time, and enables collaboration with other developers.
Why Git?
- History — every version of your code is saved forever
- Branching — work on features without breaking the main codebase
- Collaboration — multiple developers work on the same project safely
- Backup — your code lives on GitHub, not just your laptop
Git vs GitHub
- Git — the version control tool that runs on your computer
- GitHub — a website that hosts Git repositories online
Key concepts
- Repository (repo) — a project folder tracked by Git
- Commit — a snapshot of your code at a point in time
- Branch — a parallel version of your code
- Remote — the online version of your repo (on GitHub)
First-time setup
git config --global user.name "Your Name"
git config --global user.email "you@example.com"