# git — everyday workflow
Your git is wired for **delta** diffs (`cheat delta`) and **lazygit** TUI
(`lg`, `cheat lazygit`). abbr expands `g`, `gs`, `ga`… as you type (`cheat abbr`).
## Status & inspect
- **`gs`** — status (short) · **`git status`** — full
- **`gd`** — diff (unstaged) · **`gds`** — diff staged
- **`git log --oneline -10`** — recent commits · **`git show <ref>`** — a commit
## Stage & commit
- **`ga <file>`** — stage · **`ga .`** — stage all · **`git add -p`** — stage hunks
- **`gc`** — commit (opens editor) · **`gc -m "msg"`** — inline message
- **`git commit --amend`** — fix the last commit (message or add files)
## Branch & switch
- **`gco <branch>`** — checkout · **`gco -b <new>`** — create + switch
- **`gb`** — list branches · **`git switch -`** — back to previous branch
- **`git branch -d <b>`** — delete merged · **`-D`** force delete
## Sync with remote
- **`gl`** — pull · **`gp`** — push · **`git push -u origin <branch>`** — first push
- **`git fetch --all --prune`** — refresh remotes, drop gone branches
- **`git pull --rebase`** — pull without a merge commit
## Undo (careful)
- **`git restore <file>`** — discard unstaged changes to a file
- **`git restore --staged <file>`** — unstage (keep changes)
- **`git reset --soft HEAD~1`** — undo last commit, keep changes staged
- **`git reset --hard <ref>`** — DISCARD everything to that ref (destructive)
- **`git revert <ref>`** — new commit that undoes an old one (safe)
## Stash
- **`git stash`** — shelve changes · **`git stash pop`** — bring them back
- **`git stash -u`** — include untracked · **`git stash list`** — see all
> Visual git: `lg` (lazygit). Prettier diffs: already on via delta.