如何修改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>'
翻译自: https://www.systutorials.com/git-changing-global-user-name-and-user-email/
如何修改git的全局用户名