This is a guide I made while learning how to code and use git. Hope you find it useful too!

Typical flow (for 90% of cases)

git clone                   # get repo (first time)

OR (if you already cloned it)

git pull origin main                  # update local main

git checkout -b new-branch            # create branch

[make edits]

git diff                              # (optional) see what you changed
git status                            # (optional) see what’s staged vs not

git add .                             # stage changes
git commit -m “message”               # snapshot commit
git push origin new-branch            # push branch

[create PR on GitHub]

after merging the PR:

git checkout main
git pull origin main

git branch -D old-branch              # delete local branch

Quick checks

Use these when you’re unsure what’s going on.