I'm currently working on 2 projects, which expect that I configure my local username and email with different data when I push to them.
for that I'm updaing my config all the time like:
git config --local user.email "namelastname@domain.com"
Since they are different repositories, is there a way I could define an local email for each repository?
Maybe in the .gitconfig?
解决方案
For just one repo:
git config user.name "Your Name Here"
git config user.email your@email.com
For (global) default email (which is configured in your ~/.gitconfig):
git config --global user.name "Your Name Here"
git config --global user.email your@email.com
博主同时参与两个项目,需在推送时为不同仓库配置不同的本地用户名和邮箱,询问是否有办法为每个仓库定义本地邮箱,甚至考虑在.gitconfig中设置。还给出了单个仓库和全局默认邮箱的配置命令。
1299

被折叠的 条评论
为什么被折叠?



