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

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

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

  2. git config --global user.email [email protected]

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

  2. git config --global user.email [email protected]

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

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

git commit --amend --author='Your Name '

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 [email protected]

  3. # fix wrong identity

  4. $ git commit --amend --author='Your Name '

Answered by SA.

由SA回答。

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

如何修改git的全局用户名

你可能感兴趣的:(git,github,java)