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"