Github修改提交的用户和邮箱

2017.6.28 - 银川 github

有时候有多个账户要提交,或者忘记的情况,可以使用命令来重置提交的用户和邮箱

git config --global user.name <username>  
git config --global user.email <email>  

git remote set-url origin https://<username>:<password>@github.com/narulasrinivas/FirstRepository.git

以上是全局的设置,下面是局部设置

git多个账户的时候,提交的时候,可以设置本项目的提交账号

$ git config user.name 'nongdonghui'

$ git config user.email 710530499@qq.com

$ git add 2017-07-06-GitServer搭建.md

$ git commit -m 'add'
[master bff7b9f] 'add'
 1 file changed, 58 insertions(+)
 create mode 100644 "_posts/2017-07-06-GitServer\346\220\255\345\273\272.md"

$ git push
Counting objects: 4, done.
...

参考文章:

相关阅读