Skip to content
Vibecoding Guide

Git Essentials

Terminal window
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Terminal window
git status # what changed?
git add <file> # stage a specific file
git add . # stage all changes
git commit -m "message" # commit staged changes
git push # push to remote
git pull # pull latest from remote
Terminal window
git branch # list all branches
git branch <name> # create a new branch
git switch <name> # switch to branch
git switch -c <name> # create and switch in one step
git merge <name> # merge branch into current
git branch -d <name> # delete a merged branch (safe)
git branch -D <name> # force-delete a branch
Terminal window
git stash # stash all uncommitted changes
git stash pop # restore and remove last stash
git stash list # show all stashes
git stash drop # discard last stash
Terminal window
git restore <file> # discard unstaged changes in a file
git restore --staged <file> # unstage a file (keep changes)
git revert <commit> # create a new undo commit (safe, keeps history)
git reset --hard HEAD~1 # remove last commit and its changes (destructive)
Terminal window
git log --oneline -10 # last 10 commits, compact view
git diff # unstaged changes
git diff --staged # staged changes not yet committed
git show <commit> # full details of a specific commit
git blame <file> # who changed each line and when