Git Cheat Sheet

The everyday commands for non-technical folks — plain English, no jargon

Command

git fetch

What it does: Checks if anything new happened on the shared project — but doesn't change your files.

Analogy: Walking to the library front desk and asking "got anything new?" without checking anything out.

git fetch         # peek at what's new
git status        # see if you're behind
Command

git pull

What it does: Grabs the latest changes and updates your files. It's fetch + merge in one step.

Analogy: Checking the catalog and bringing the updated book back to your desk.

git pull          # grab latest & update files
Run this at the start of every work session.
Concept

Fetch vs. Pull — Side by Side

git fetchgit pull
Downloads new info?YesYes
Updates your files?NoYes
Can cause conflicts?NeverSometimes
When to useWant to peek firstReady to get latest
Concept

Merging

What it does: Combines two different versions of the project into one. Usually happens automatically when you git pull.

Analogy: Two people wrote different chapters — the editor staples them together into one book.

  • Clean merge: Different parts were edited — Git handles it automatically
  • Conflict: Same lines were edited — Git asks you to pick
Don't Panic

Merge Conflicts

When two people edit the same lines, Git asks you to choose. It looks like this:

<<<<<<< HEAD
The meeting is on Tuesday.
=======
The meeting is on Wednesday.
>>>>>>> main

Fix it: Keep the right version, delete the markers, save, then:

git add the-file.txt
git commit -m "Resolved conflict"
Practice

Your Daily Workflow

Follow this order every time and you'll stay out of trouble:

git pullGet latest
git checkout -b my-branchBranch out
Do your workEdit files
git add .Stage changes
git commit -m "..."Save snapshot
git pushShare it
Practice

Good Commit Messages

Describe what you did in one clear sentence. Your future self will thank you.

Bad

"fixed stuff" "update" "asdf"

Good

"Updated pricing on homepage" "Fixed broken footer link" "Added team photos to About"
Survival Kit

Commands You'll Use Constantly

git status        # Where am I? What changed?
git log --oneline  # Show recent history
git branch        # What branch am I on?
git diff          # Show what I changed
When in doubt, run git status. It always tells you what to do next.
Practice

The Golden Rules

#RuleWhy
1Pull before you pushGet the latest before sharing yours — like reading the group chat before replying
2Commit oftenSmall saves are easier to undo than big ones — save your game frequently
3Write clear messagesFuture-you won't remember what "fixed stuff" means
4Check your branchMake sure you're editing the right document before you start typing
5Don't panic on conflictsIt's just Git asking a question, not an error — pick the right version and move on