设置Git

基本指令

用户设置:

$ git config --global user.name "XXXXXX"
$ git config --global user.email "[email protected]"

检查当前设置:
$ git config --list

设置文件的保存位置:Git相关的设置都默认保存在自己账号下的.gitconfig文件中

为每个项目设置不同的作者

$ git config --loca user.name  xxxxx
$ git config --local user.email [email protected]

其他设置

更换编辑器

Vim是Git的默认编辑器,可以在终端机执行以下命令更换编辑器:
git config --global core.editor emacs
将Vim编辑器更换为Emacs

设置缩写

$ git config --global alias.co checkout
$ git config --global alias.br branch

设置完成后,输入git co 就可以实现输入git checkout命令一样的效果

猜你喜欢

转载自blog.csdn.net/weixin_44333597/article/details/109437535
今日推荐