如何修改git的全局用户名_Git:更改全局用户名和用户电子邮件

如何修改git的全局用户名

How to set the global user name and user email for git?

如何为git设置全局用户名和用户电子邮件

We may be asked to set our global user name and user email if it is the first time that we use git on a machine:

如果这是我们第一次在机器上使用git,可能会要求我们设置全局用户名和用户电子邮件:

Your name and email address were configured automatically based on
your username and hostname. Please check that they are accurate. You
can suppress this message by setting them explicitly:

您的姓名和电子邮件地址是根据以下信息自动配置的
您的用户名和主机名。 请检查它们是否正确。 您
可以通过显式设置它们来禁止显示此消息:

git config --global user.name "Your Name"
git config --global user.email you@example.com
git config --global user.name "Your Name"
git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

如果用于此提交的身份错误,则可以使用以下方法进行修复:

git commit --amend --author='Your Name <you@example.com>'

However, no message tells us how to update these information (of course, git does not know that we want to change). To change the configurations, the same scripts can be used:

但是,没有消息告诉我们如何更新这些信息(当然,git不知道我们要更改)。 要更改配置,可以使用相同的脚本:

$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com

# fix wrong identity
$ git commit --amend --author='Your Name <you@example.com>'
Answered by SA.
由SA回答。

翻译自: https://www.systutorials.com/git-changing-global-user-name-and-user-email/

如何修改git的全局用户名

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值