This is a list of common git aliases and shortcuts. In my opinion, cryptic aliases like “gp” for git-push or “gc” for git-checkout are very hard to remember. Therefore, I will write longer aliases that are more easily to remember. Since bash or zsh have auto-completion, you can just write “gitco” and then press and let the bash auto-complete it to “gitcommit”. The most time consuming is the whitespace between the commands, since auto-completion can not guess what command I need. I think that is a good compromise between saving time typing and how easy it is to remember all of the aliases and shortcuts. I will add additional aliases and shortcuts as I need them.
Updated on 2018 / 09 / 21
if git --version>/dev/null; then alias gitcheck="git checkout" alias gitb="git branch" alias gitm="git merge" alias gitt="git tag" alias gitpush="git push" alias gitpull="git pull" alias gitpusho="git push origin" alias gitpullo="git pull origin" alias gitcommit="git commit" alias gitcommita="git commit -a" alias gitstash="git stash" alias gitstashp="git stash pop" alias gitstartrelease="git flow release start" alias gitfinishrelease="git flow release finish" # # robobeerun projects # ROBOBEE_ID_RSA="${HOME}/Projects/robobeerun.com/robobee-key/robobee_id_rsa" # # Usage: # # gitrobobeegithubclone URL ... # function gitrobobeegithubclone() { ssh-agent bash -c "ssh-add $ROBOBEE_ID_RSA; git clone -o github $@" } # # Usage: # # gitrobobeegithubpull ... # function gitrobobeegithubpull() { ssh-agent bash -c "ssh-add ${ROBOBEE_ID_RSA}; git pull github $@" } # # Usage: # # gitrobobeegithubpush ... # function gitrobobeegithubpush() { ssh-agent bash -c "ssh-add ${ROBOBEE_ID_RSA}; git push github $@" } fi