Are you using a credential helper? What does git config --get credential.helper
show? If it shows something, then perhaps the information is being cached by the credential helper. One way of removing it would be:
printf "protocol=https\nhost=github.com\npath=COMPANY/PROJECT.git\nusername=MYUSERNAME\n\n" |
git credential fill
It it prompts you for the password, then it's not cached in that particular form. It could be that it was cached without the .git
on the end:
printf "protocol=https\nhost=github.com\npath=COMPANY/PROJECT\nusername=MYUSERNAME\n\n" |
git credential fill
You can remove the credential with:
printf "protocol=https\nhost=github.com\npath=COMPANY/PROJECT.git\nusername=MYUSERNAME\n\n" |
git credential remove
or, if no '.git' was present on the url:
printf "protocol=https\nhost=github.com\npath=COMPANY/PROJECT\nusername=MYUSERNAME\n\n" |
git credential remove
Note that the only difference between these two commands and the above commands is that git credential fill
became git credential remove
. Also, if you post any data that comes from the git credential fill
command, make sure to obscure your username and password.
If none of that helps, you may need to look at your ~/.gitconfig
. You may have some credential.<url>
blocks set up as outlined in this man page. Alternatively, you might be able to use that to alter the username.