Wrappers for common git commands so they can be used in aliases very efficiently.
All commands come with default git completion.
zgen load seletskiy/zsh-git-smart-commands
With arguments same as git commit -m
. Without arguments behaves like git commit -v
.
Also, removes necessity of quotes around commit message.
alias c='git-smart-commit'
Then, commits can be done via:
c my supper commit message
Autocompletion always works:
c my blah blah --am<TAB>
# ==> c my blah blah --amend
Note: quotes are not mandatory now.
alias a='git-smart-add'
Without arguments will add all files in the repo to the index. Otherwise will act as specified in commmand line.
alias p='git-smart-push seletskiy'
Seek for remote named as first argument, and if it is found, then push changes to that remote.
Otherwise push to origin.
alias u='git-smart-pull'
If working directory is dirty, then first stash changes, pull remote and pop changes back.
alias r='git-smart-remote'
If repo do not have remote yet, will add new remote named origin with url specified as first argument.