DEV Community

Discussion on: 5 Great Git CLI Shortcuts

Collapse
 
shostarsson profile image
Rémi Lavedrine

That's a good one.
I must say that I never goes beyond the aliases that are by default in zsh and oh_my_zsh.

Here is a quick extract of the aliases available in oh_my_zsh :

g=git
ga='git add'
gaa='git add --all'
gap='git apply'
...
glo='git log --oneline --decorate'
...
grmv='git remote rename'
groh='git reset origin/$(git_current_branch) --hard'
grrm='git remote remove'
grset='git remote set-url'
grt='cd "$(git rev-parse --show-toplevel || echo .)"'
gru='git reset --'
...
gupv='git pull --rebase -v'
gwch='git whatchanged -p --abbrev-commit --pretty=medium'
gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
Collapse
 
jrgould profile image
Jeff Gould

I wish that the aliases in oh_my_zsh were commented to tell you what they do in plain english. I will often look in there and try to add a new one to my arsenal, but that becomes a bit of a research project since I'm not fluent in git commands and typically need to look things up, at least just to be sure that the commands will do what I suspect.