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

后端 未结 15 788
醉酒成梦
醉酒成梦 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

    This is not exactly what you're asking for, but you could set up some shell aliases in your ~/.bashrc for the Git commands you use most frequently:

    alias commit='git commit'
    alias checkout='git checkout'
    ...
    

    Also note that you can create aliases within Git itself:

    git config --global alias.ci commit
    git config --global alias.co checkout
    ...
    

    This lets you type git ci instead of git commit, and so on.

提交回复
热议问题