Git配置用戶名、郵箱

 

當安裝完 Git 應該作的第一件事就是設置你的用戶名稱與郵件地址。 git

這樣作很重要,由於每個 Git 的提交都會使用這些信息,而且它會寫入到你的每一次提交中,不可更改。vim

不然,用戶名會顯示爲unknown,沒法區分代碼是開發團隊中的哪一個成員提交的。spa

 

一 檢查配置code

 

git config --get user.name
git config --get user.email

 

二 全局配置blog

 

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

 

三 查看配置文件開發

 

Mac是~/.gitconfig文件:get

 

vim ~/.gitconfig

 

Windows是 Users/用戶/.gitconfig文件:it

使用Notepad++查看。class

相關文章
相關標籤/搜索