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

首次使用git时可能需要设置全局用户名和邮箱。通过运行`gitconfig--globaluser.nameYourName`和`gitconfig--globaluser.emailyou@example.com`可以进行设置。如果已有的身份信息错误,可使用`gitcommit--amend--author=YourName`来修正。
摘要由CSDN通过智能技术生成

如何修改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:

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

 
 
  1. git config --global user.name "Your Name"

  2. git config --global user.email you@example.com

 
 
  1. git config --global user.name "Your Name"

  2. 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不知道我们要更改)。 要更改配置,可以使用相同的脚本:

 
  1. $ git config --global user.name "Your Name"

  2. $ git config --global user.email you@example.com

  3. # fix wrong identity

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

Answered by SA.

由SA回答。

翻译自: Git: changing global user name and user email - SysTutorials

如何修改git的全局用户名

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值