用 git config 配置用戶信息

from:http://www.quanlei.com/2012/03/3053.html

用git config –list能夠查看當前的git配置列表
若是已經配置了,則會看到user.name 和 user.email的配置信息
若是沒有,通常狀況下在git提交時會使用機器名,諸如:unknown dev@xxx-PC.(none) 等類型的Author信息,確定不方便了。
建議都配置明確的user.name 和 user.email信息。
能夠經過下面的命令進行配置:
1
2
git config user.name xxx
git config user.email xxx@xxx.com
配置完成後能夠經過 git config –list 查看到


問題:
error: could not lock config file .git/config: No such file or directory

解決辦法:
1. mkdir ~/.git 2. git config --global user.email "m...@school.com"
相關文章
相關標籤/搜索