Git vs GitHub

Course 1 · Ch 1
What Git & GitHub Are — and Why They Matter
The difference between git and GitHub, installing git on your machine, and setting up a GitHub account

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
A version control system — a program that runs on your own computer. It records snapshots of your project over time (called commits), so you can see exactly what changed, when, and revert to any previous point if something breaks.

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
A website and service that hosts git projects ("repositories") online. It adds things git itself doesn't have: a visual interface, issue tracking, pull requests for reviewing changes, and a place for other people to find and contribute to your code.

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.
A useful analogy
Git is like the autosave-with-full-history feature of a word processor — running locally, tracking every version of your document. GitHub is like uploading that document to a shared drive where colleagues can see it, comment on it, and propose their own edits for you to accept or reject.

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.

🪟 Windows
Download the installer from 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.
🍎 macOS
Easiest route: install Homebrew, then run brew install git. Alternatively, installing Xcode Command Line Tools (xcode-select --install) bundles a working git as well, though typically an older version.
🐧 Linux
Use your distribution's package manager — 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
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.name "Your Name"
$ git config --global user.email "you@example.com"
# Verify it took effect:
$ git config --global user.name
Your Name
Use the same email as your GitHub account
If the email in your git config doesn't match an email registered to your GitHub account, your commits won't be linked to your GitHub profile — they'll still work, but won't show your avatar or count toward your contribution graph. Worth setting correctly from the start.

Setting Up Your GitHub Account

1
Create an account at github.com
Pick a username carefully — it appears in every repository URL you create and is genuinely awkward to change later once you have projects, stars, and followers attached to it.
2
Verify your email address
Required before you can create repositories or interact with most features. Use the same address you set in git config --global user.email above where possible.
3
Enable two-factor authentication
Settings → Password and authentication → Two-factor authentication. GitHub accounts are a common target for credential theft because of what they grant access to — an authenticator app (not SMS) is the recommended method.
4
Fill in your profile (optional, but worthwhile)
A profile photo, bio, and a pinned repository or two make your account look active and trustworthy — relevant the moment you start collaborating with anyone else.
You don't need to connect git to GitHub yet
Creating an account is enough for this chapter. Chapter 5 covers connecting your local git installation to GitHub properly — SSH keys, personal access tokens, and your first 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