Git is a system that tracks every change you make to your code over time. Think of it like Google Docs version history — but for code. Every time you save a version, git remembers it. You can go back to any point.
GitHub is where that history gets stored online, so it's backed up and other people can see it. Git is the tool. GitHub is the warehouse.
Plain English: "Start watching this folder." You run this once, at the very beginning. It turns a regular folder into one git is tracking. Nothing is saved yet — git is just awake now.
Plain English: "Put these files in the box to be shipped." Git doesn't save everything automatically. You pick which changed files to include in the next save.
git add .→ put ALL changed files in the boxgit add filename.py→ put just that one file in the box
After this: files are "staged" (ready to save) but not saved yet.
Plain English: "Seal the box and write a label on it."
A commit is a saved snapshot. The -m "message" part is the label you write on the box so you remember what's inside.
git commit -m "added login page"→ seal and label it
After this: the save exists on your computer. It hasn't gone anywhere yet.
Plain English: "Send the box to GitHub's warehouse." This uploads your saved versions to GitHub. Once it's there, it's backed up and Vercel can see it.
git push origin main→ send everything to the main branch on GitHub
After this: your code is on GitHub. If Vercel is connected, it starts deploying automatically.
Plain English: "Bring the latest version down from GitHub to your computer." If anything changed on GitHub since you last looked — pull brings those changes to your machine.
After this: your local files match what's on GitHub.
Plain English: "Download a complete copy of a project from GitHub."
git clone https://github.com/username/repo-name→ download the whole thing
After this: you have a full working copy of the project on your machine.
Plain English: "Show me what's changed since my last save." Lists: files you changed but haven't boxed yet, files in the box ready to commit, and files git isn't tracking at all. Nothing changes when you run this — it just shows you the current state.
Plain English: "Tell git where to send the code when you push." Before you can push, git needs to know the GitHub address. You only do this once per project.
git remote add origin https://github.com/username/repo-name.git
After this: git knows where "origin" (GitHub) is. Now push will work.
"I ran git push and got permission denied"
Git is using SSH and your computer hasn't done the secret handshake with GitHub yet. Easiest fix: use HTTPS instead. Get the HTTPS URL from GitHub (starts with https://, not git@) and run git remote set-url origin [that URL].
"fatal: remote origin already exists"
You already told git where GitHub is. Instead of add, use set-url:
git remote set-url origin https://github.com/your/repo.git
"error: failed to push some refs"
GitHub has changes your computer doesn't know about. Run git pull origin main first, then push again.
First time setting up a project on GitHub:
git init— start watching the foldergit add .— box everything upgit commit -m "first version"— seal and label itgit remote add origin [GitHub URL]— tell git where GitHub isgit push -u origin main— send it
Every time after that:
git add .— box your changesgit commit -m "what you changed"— seal itgit push— send it