在Git中,本身的姓名与每个commit提交绑定在一块儿。若是你在使用Azure DevOps Server中的Git Repo时,必定要注意commit中的提交者与服务器上的推送者,是两个概念。git
在Git中,设置本身的名字有两个层面的内容:全局设置(global),库设置。bash
全局设置中的设置会影响全部库,库层级的设置只会影响特定的库。服务器
git config --global user.name “张洪君“命令行
git config -- global user.email “zhanghongjun@bjgreatsoft.com”blog
完成上面的设置后,能够使用get参数显示设置后的信息,例如get
git config - -global - -get user.nameit
git config - -global - -get user.emailemail
若是使用Windows计算机,你还能够在本身用户目录下(c:\users\zhanghongjun)找到一个文件.gitconfig,里面保存上面的设置信息im
在某些场景中,咱们须要对特定的库作单独的设置,那么能够在在库层级上作下面的是指img
cd myrepoFolder
git config user.name “zhanghongjunInRepo”
git config user.email “zhanghongjunInRepo@mycom.cn
一样,你能够使用get属性来获取库层级中的设置
git config – -get user.name
你也能够在Git库目录的.git文件夹中,找到config文件,里面记录了库层级的设置信息
--
http://www.cnblogs.com/danzhang/ DevOps MVP 张洪君
--