git本地配置用户名,Git:为每个仓库设置不同的本地用户名和用户电子邮件

博主同时参与两个项目,需在推送时为不同仓库配置不同的本地用户名和邮箱,询问是否有办法为每个仓库定义本地邮箱,甚至考虑在.gitconfig中设置。还给出了单个仓库和全局默认邮箱的配置命令。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值