Git 修改用戶名以及提交郵箱


問題背景

在提交自己的 Github 代碼,(盡管有重新設置了 自己的SSH),但是提交結果卻顯示自己GitHub提交的,並非公司郵箱:

驗證當前本地屬性

怎么知道本地有設置?

git config --local --list

 

 

怎么設置本地屬性? 

git config user.name
git config user.email

 

解決方法

法一:使用命令修改git的用戶名和提交的郵箱

        1)修改全局

         如果你要修改當前全局的用戶名和郵箱時,需要在上面的兩條命令中添加一個參數,--global,代表的是全局。

git config  --global user.name 你的目標用戶名;
git config  --global user.email 你的目標郵箱名;

 

        2)修改當前的 project

        git 修改當前的project的用戶名的命令為:

git config user.name 你的目標用戶名;

 

        git 修改當前的project提交郵箱的命令為:

git config user.email 你的目標郵箱名;

 

 

重新提交

現在就可以顯示本人提交了。

 

【Reference】

1、http://blog.csdn.net/helinlin007/article/details/52266169

2、https://segmentfault.com/q/1010000002600167


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM