Git & Version Control
A time machine for your code
Track every change, undo mistakes, and collaborate with confidence. Git is the version control system behind almost all modern software.
Git Setup
Install Git, configure it, and make your first commit.
Install Git
# Download from https://git-scm.comWhat it does
Git is the command-line tool that records the history of your project.
Why you need it
Every other step β committing, branching, pushing to GitHub β runs through Git.
Alternatives: GitHub Desktop or your editor's built-in Git UI.
Configure your identity
git config --global user.name "Your Name"
git config --global user.email "you@example.com"What it does
Git stamps each commit with your name and email.
Why you need it
So your contributions are attributed correctly on GitHub and in history.
Start a repo & first commit
git init
git add .
git commit -m "Initial commit"What it does
Initialize a repository, stage your files, and save the first snapshot.
Why you need it
This creates the history that lets you track and undo changes.
Push to GitHub
git remote add origin <url>
git push -u origin mainWhat it does
Connect your local repo to a GitHub repository and upload it.
Why you need it
A remote backs up your code and enables collaboration and deployment.