How do I avoid typing “git” at the begining of every Git command?

后端 未结 15 771
醉酒成梦
醉酒成梦 2021-01-29 22:31

I\'m wondering if there\'s a way to avoid having to type the word git at the beginning of every Git command.

It would be nice if there was a way to use the

15条回答
  •  清歌不尽
    2021-01-29 22:40

    I'm a big fan of using aliases in ~/.bash_profile for my GitBash. If you go with this approach, here are some of my favorites:

    # git
    alias gw='git whatchanged'
    alias gg='git grep -n -C8'
    alias ggi='git grep -i -n -C8'
    alias gb='git branch'
    alias gbd='git branch -D'
    alias gba='git branch -a'
    alias gc='git checkout'
    alias gcp='git cherry-pick'
    alias gfo='git fetch origin'
    alias s='git status'
    alias gmom='git merge origin/master'
    alias grom='git rebase origin/master'
    alias gpom='git pull origin master'
    alias pplog='git log --oneline --graph --decorate'
    

提交回复
热议问题