$ cat ~/.alias
alias g='git'
$ cat ~/.gitconfig
[alias]
st = status
br = branch
co = checkout
I don't see anyone else doing g='git' but I don't have to write out an alias for each command. For less frequently used git commands I forget an [alias] shortcut but I can always use the 'g' shortcut.
$ cat ~/.bash_profile | grep git
alias gco="git checkout"
alias gpu="git pull"
alias gcom="git commit"
alias gfr="git fetch && git rebase -i"
alias g="git"
Comments
If you want to keep bash completion on working when having git aliased to g, try to add this line to your .bashrc:
I was curious about this, so I checked: zsh will preserve completions if you `alias g=git`.
Yes, I use it too! Saves me a lot of time.
For people using oh-my-zsh, the git plugin has similar ones and quite a few more handy ones.
https://github.com/robbyrussell/oh-my-zsh/blob/master/plugin...