如图,我使用:
$git config --global user.email "tanteng@gmail.com"
$git config --global user.name "tanteng"
想修改显示的用户名,却不能实现。请问如何修改呢?
ps:这台机子是以前别人使用的,现在我接手,想把绿色显示用户名的地方改成我的。
天蓬老师2017-05-02 09:20:22
The username displayed in green is the login account and has nothing to do with git.
What you need is the control panel, thank you. Click to change the account name and that’s it
PHP中文网2017-05-02 09:20:22
It seems that the questioner is using git on win. If you use some tools such as TortoiseGit, you can have an intuitive understanding of these problems first.
These operations are mapped into commands as @nightire said.
滿天的星座2017-05-02 09:20:22
When
--global
是设置全局的(当前用户的全局)属性,也就是说当你的 repo 没有设置项目的 user.name
和 user.email
is used, this will be used by default. (For example, when you create a new repo)
If you find that it doesn't work, nine times out of ten it's because the repo you are in has already set up a local one user.name
user.email
, so the global one is not used.
How do I know if there are local settings? git config --local --list
Take a look.
How to set local properties? git config user.name/email
.