Skip to content

Instantly share code, notes, and snippets.

@AdamMarsden
Last active May 25, 2024 01:42
Show Gist options
  • Save AdamMarsden/1c9336b65fa185cdfb14 to your computer and use it in GitHub Desktop.
Save AdamMarsden/1c9336b65fa185cdfb14 to your computer and use it in GitHub Desktop.
Oh My Zsh - Git Cheat Sheet

#Oh My Zsh - Git Cheat Sheet

ggit

gstgit status

glgit pull

gupgit pull --rebase

gpgit push

gdgit diff

gdcgit diff --cached

gdvgit diff -w "$@" | view -

gcgit commit -v

gc!git commit -v --amend

gcagit commit -v -a

gca!git commit -v -a --amend

gcmsggit commit -m

gcogit checkout

gcmgit checkout master

grgit remote

grvgit remote -v

grmvgit remote rename

grrmgit remote remove

gsetrgit remote set-url

grupgit remote update

grbigit rebase -i

grbcgit rebase --continue

grbagit rebase --abort

gbgit branch

gbagit branch -a

gcountgit shortlog -sn

gclgit config --list

gcpgit cherry-pick

glggit log --stat --max-count=10

glgggit log --graph --max-count=10

glggagit log --graph --decorate --all

glogit log --oneline --decorate --color

gloggit log --oneline --decorate --color --graph

gssgit status -s

gagit add

gmgit merge

grhgit reset HEAD

grhhgit reset HEAD --hard

gcleangit reset --hard && git clean -dfx

gwcgit whatchanged -p --abbrev-commit --pretty=medium

gstsgit stash show --text

gstagit stash

gstpgit stash pop

gstdgit stash drop

ggpullgit pull origin $(current_branch)

ggpurgit pull --rebase origin $(current_branch)

ggpushgit push origin $(current_branch)

ggpnpgit pull origin $(current_branch) && git push origin $(current_branch)

glp_git_log_prettily

@AleksandarSavic95
Copy link

Thank You! This is wonderful! 😊

@postylem
Copy link

postylem commented Mar 3, 2022

Is the gcl shortcut listed there correct? Perhaps I'm using a different version (just installed omz, so, newer?), but for me which gcl gives gcl: aliased to git clone --recurse-submodules, not git config --list.

@bahtiyormurotaliyev
Copy link

No'tog'ri

@jessicarmiller
Copy link

Thanks for assembling this! As per another comment, current version of omz has gcl as gcl: aliased to git clone --recurse-submodules, gcf is the shortcut for git config --list.

@DavidAdrian8ag
Copy link

great!!! thank you very much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment