I
I
IvanS19892021-02-18 16:43:57
git
IvanS1989, 2021-02-18 16:43:57

Why can't I change the user in git?

[email protected] MINGW64 ~ (master)
$ git config --global --list
user.name=Ivan Serov
[email protected]
user.name=Ivan
user.name=Ivan
user.name=Ivan
difftool.sourcetree .cmd='' "$LOCAL" "$REMOTE"
mergetool.sourcetree.cmd=''
mergetool.sourcetree.trustexitcode=true
core.autocrlf=true
core.safecrlf=warn
core.quotepath=off
color.ui=auto

[email protected] SerVantes MINGW64 ~ (master)
$ git config --global user.name "Ivan Sierov"
warning: user.name has multiple values
​​error: cannot overwrite multiple values ​​with a single value
Use a regexp, --add or --replace-all to change username.

What does it ask to change into values, why can't I change the username?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0nkery, 2021-02-18
@IvanS1989

The output of the last command tells you what to do. You somehow ended up with multiple usernames in the global git config, which can be fixed with:

$ git config --global --replace-all user.name "Ivan Sierov"

Or, if you need several names, you can add one more:
$ git config --global --add user.name "Ivan Sierov"

Wangyu, that's how you got several usernames before.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question