How to alias 'git checkout' to 'git co'

孤街醉人 提交于 2019-12-03 00:12:39

问题


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


来源:https://stackoverflow.com/questions/14489109/how-to-alias-git-checkout-to-git-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!