OhMyZsh Git Cheat Sheet

A Programming › Git cheat sheet in English by btqn

Custom Cheat Sheet to the OhMyZsh Git Plugin.

8,948 views 1,506 downloads 18 Jan 2022 History

Add

ga
git add
gaa
git add --all

Merge

gm
git merge
gmom
git merge origin­/$(­git­_ma­in_­branch)
gmum
git merge upstre­am/­$(g­it_­mai­n_b­ranch)
gma
git merge --abort

Push

gp
git push
gpf
git push --forc­e-w­ith­-lease
gpsup
git push --set-­ups­tream origin $(git_­cur­ren­t_b­ranch)

Stash

gsta
git stash save
gstaa
git stash apply
gstc
git stash clear
gstd
git stash drop
gstl
git stash list
gstp
git stash pop

Diff

gd
git diff
gdup
git diff @{upst­ream}

Branch

gb
git branch
gba
git branch -a
gbd
git branch -d

Fetch

gf
git fetch
gfa
git fetch --all --prune
gfo
git fetch origin

Checkout

gcb
git checkout -b
gco
git checkout
gcm
git checkout $(git_­mai­n_b­ranch)
gcd
git checkout $(git_­dev­elo­p_b­ranch)

Pull

gl
git pull
ggl
git pull origin $(curr­ent­_br­anch)
ggu
git pull --rebase origin $(curr­ent­_br­anch)
gpr
git pull --rebase

Commit

gcam
git commit -a -m
gcmsg
git commit -m
gc
git commit -v
gc!
git commit -v --amend
gcn!
git commit -v --no-edit --amend
gca
git commit -v -a
gca!
git commit -v -a --amend
gcan!
git commit -v -a --no-edit --amend

Reset

grh
git reset HEAD
grhh
git reset HEAD --hard

Rebase

grb
git rebase
grba
git rebase --abort
grbc
git rebase --continue
grbi
git rebase -i
grbs
git rebase --skip

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.