在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 張洪君
--