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.
--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.nameuser.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.
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
This has nothing to do with git, you need to check the bash prompt
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.
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
.