-->

How to alias 'git checkout' to 'git co

2019-03-07 16:07发布

问题:

I'd like the command git co to be the same as typing git checkout.

A normal Bash alias (alias co='checkout') doesn't work.

回答1:

The command:

git config --global alias.co checkout

will create a git alias to do that. It will add the following entry into your global ~/.gitconfig file:

[alias]
    co = checkout


回答2:

Also, can edit this into your git config:

[alias]
   co = checkout