ListDrop
*
Explore
Paste
Help
Explore
/
@sam_ships
git commands i always forget
too niche for the official cheat sheet, common enough that i keep googling them
Follow
3
Fork
Share
Focus
Items
12
Comments
2
Changes
15
Nº
Item
01
git reflog
the one that's saved me from a bad reset more times than i'll admit
02
git rebase -i HEAD~5
interactive rebase to squash commits before a pr. always forget the tilde number i actually need
03
git commit --fixup <hash>
pairs with rebase --autosquash. huge once it clicks, ymmv how long that takes
04
git rebase --autosquash
05
git bisect start
binary search through history for the commit that broke something. underused, i forget the syntax every time
06
git stash pop
not git stash apply. pop actually removes it from the stash list, apply leaves a copy sitting there
07
git cherry-pick -x <hash>
records which commit it came from in the message. worth it on shared branches
08
git worktree add ../hotfix branch-name
09
git log --oneline --graph --all
alias this immediately on every new machine and still type it out longhand half the time anyway
10
git diff --staged
shows what's actually about to be committed, not the working tree diff
11
git remote prune origin
cleans up stale remote branches locally. do this before you panic about a branch that's "gone"
12
git blame -L 10,20 -- file.js
blame just a line range instead of the whole file's history scrolling past
Suggest an item
Comment
Follow for changes
3
Related lists
@sam_ships
cli tools i actually use daily
14 items
fzf
zoxide
ripgrep
fd
bat
jq
+8
1
359
0
🔥
❤️
👀
4
Follow
13