Git vs GitHub
Before writing a single command, it's worth being completely clear on one point that trips up almost every beginner: git and GitHub are not the same thing. Git is the tool that tracks changes to your files. GitHub is a website that hosts copies of git projects online and adds collaboration features on top. You can use git without ever touching GitHub — but GitHub is what makes git genuinely useful for working with other people, or simply backing your work up somewhere other than your own hard drive.
Git vs GitHub
Git works entirely offline. You could use git for the rest of your life and never create a GitHub account — every project would just live on your own machine, with full history.
GitHub is one option among several — GitLab and Bitbucket are direct competitors that also host git repositories with similar features. This series focuses on GitHub since it's by far the most widely used.
Why Use Version Control at All?
If you've ever ended up with files named project_final.zip, project_final_v2.zip, and project_final_v2_ACTUALLY_FINAL.zip, you've already invented a crude form of version control — manually, and without any way to see exactly what changed between them. Git solves the same problem properly:
- Full history, automatically. Every commit is a complete, named snapshot — no more guessing which zip file had the working version.
- See exactly what changed. Git can show you the precise lines added, removed, or modified between any two points in history.
- Safe experimentation. Branches (covered in Chapter 4) let you try something risky without touching your working version at all.
- Collaboration without overwriting each other. Multiple people can work on the same project and git helps combine everyone's changes safely — this is the subject of several scenario chapters later in this series.
- A backup that lives off your machine. Once pushed to GitHub, your project survives a hard drive failure, a lost laptop, or — as covered in Chapter 9 — a folder move gone wrong.
Installing Git
Git is free, open-source, and available on every major operating system. Installation takes a couple of minutes.
git-scm.com and run it. The defaults are fine for almost everyone — the one setting worth checking is the default editor for commit messages (Vim is the default; switch it to Notepad or VS Code if you're not comfortable with Vim yet).
This installs Git Bash, a terminal that behaves like a Linux/Mac shell — the commands throughout this series will work identically there.
brew install git. Alternatively, installing Xcode Command Line Tools (xcode-select --install) bundles a working git as well, though typically an older version.
sudo apt install git on Debian/Ubuntu, sudo dnf install git on Fedora. Git is so fundamental that most distros offer it as a single, simple package.
Verifying the install
git version 2.45.1
Any version starting with 2.x is fine for everything in this series. If the command isn't recognised, restart your terminal — installers sometimes need a fresh shell to pick up the new PATH entry.
One-time setup — telling git who you are
Every commit records an author name and email. Set these once, globally, and every project on your machine will use them automatically:
$ git config --global user.email "you@example.com"
# Verify it took effect:
$ git config --global user.name
Your Name
Setting Up Your GitHub Account
git config --global user.email above where possible.git push. For now, the goal is just having both pieces installed and ready.
Chapter 1 Quick Reference
- Git = local version control tool, runs entirely on your machine, works offline
- GitHub = a website that hosts git projects online and adds collaboration features
- Check install:
git --version - One-time identity setup:
git config --global user.name/user.email - Use the same email in git config as your GitHub account for commits to link to your profile
- GitHub account setup: verified email → two-factor authentication (authenticator app, not SMS) → basic profile
- Next chapter: core git concepts — working directory, staging area, and your first commit