What is Git and Why Use It?
Git is a distributed version control system that tracks changes in your code over time. Think of it as an unlimited undo system for your entire project.
Why developers use Git
Every professional development team uses version control. Git lets you track every change, collaborate without overwriting each other's work, and roll back when things go wrong.
Key concepts
Repository (repo) — A project folder tracked by Git. It contains all your files plus the complete history of every change.
Commit — A snapshot of your project at a specific moment. Each commit has a unique ID and a message describing what changed.
Branch — A parallel version of your project. You can experiment on a branch without affecting the main code.
Installing Git
# macOS (with Homebrew)
brew install git
# Ubuntu/Debian
sudo apt-get install git
# Windows — download from git-scm.com
# Verify installation
git --versionFirst-time setup
git config --global user.name "Your Name"
git config --global user.email "you@example.com"These identify you as the author of your commits. Use the same email as your GitHub account for proper attribution.