3 ms·
$ cat ~/.alias alias g='git' $ cat ~/.gitconfig [alias] st = status br = branch co = checkout I don't see anyone else doing g='g
by gregwebs 13y ago
$ 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.
- rahij 13y agoYes, I use it too! Saves me a lot of time. $ 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"
- anamexis 13y agoFor 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/plugins/git/git.plugin.zsh https://github.com/robbyrussell/oh-my-zsh/blob/master/plugin...
- nperson 13y agoIf you want to keep bash completion on working when having git aliased to g, try to add this line to your .bashrc: # Complete aliased git, too. complete -o default -o nospace -F _git g
- mythmon_ 13y agoI was curious about this, so I checked: zsh will preserve completions if you `alias g=git`.