首页 > 其他 > 详细

Git 03 git config 增删改查,取别名

时间:2015-08-03 18:48:31      阅读:233      评论:0      收藏:0      [点我收藏+]

1、初始化用户提交的用户名、邮箱

$ git config --global user.name chenchangqing          // 配置用户名
$ git config --global user.email chenchangqing@126.com     // 配置邮箱  
$ git config --list --global                     // 查询配置 
user.name=chenchangqing
user.email=chenchangqing@126.com

2、继续增加一个user.name

$ git config --global --add user.name changqing         // 新增
$ git config user.name 
changqing
$ git config --get user.name 
changqing
$ git config --list --global 
user.name=chenchangqing
user.email=chenchangqing@126.com
user.name=changqing

 3、删除一个user.name

$ git config --global --unset user.name               // 重置
warning: user.name has multiple values
$ git config --global --unset user.name changqing
warning: user.name has multiple values
$ git config --global --unset user.name changqing
warning: user.name has multiple values
$ git config --global --unset user.name chenchangqing
$ git config --list --global
user.email=chenchangqing@126.com
user.name=changqing

4、重置user.name

$ git config --global --unset user.name 
$ git config --get user.name
$ git config --global user.name changqing
$ git config --list --global 
user.email=chenchangqing@126.com
user.name=changqing

5、命令别名

$ git c
c             ca            checkout      cherry        cherry-pick   citool        clean         clone         cm            column        commit        config        
$ git c
c             ca            checkout      cherry        cherry-pick   citool        clean         clone         cm            column        commit        config        
$ git config --global alias.ci commit
$ git c
c             ca            checkout      cherry        cherry-pick   ci            citool        clean         clone         cm            column        commit        config 

红色命令作用是,当用户想提交代码上也可以直接使用git ci

Git 03 git config 增删改查,取别名

原文:http://www.cnblogs.com/cqchen/p/4699819.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!