Reputation: 99
So, I changed my git username to something different a while back. Now, I am attempting to change it back. I used the following command with Git Bash:
git config --global user.name "PreviousUserName"
I was unable to change the username, which became apparent after using this command since my current username showed up, as if the previous command was ignored:
git config user.name
"CurrentUserName"
I find it strange that Git Bash did not ask for a password upon changing my credentials, since I am using HTTP and not an SSH key on my laptop. Does anyone know what the issue could be? HTTP works fine for my purposes, so if someone has a solution with HTTP, that would be preferred.
Upvotes: 2
Views: 2874
Reputation: 21
I faced the same problem. Going to repo folder and manually adding
[user]
name=""PreviousUserName"
to .git/config worked fine.
Upvotes: 0
Reputation: 521314
I speculate that the username was set for the particular repo in question, and that this previous setting is overriding the global setting you made. If so, then navigate to this repo and try the following:
git config user.name "PreviousUserName"
Upvotes: 2