I have all the settings configured in a way that appears correct, but git is still defaulting to an incorrect username.
I have the following set in git config:
alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.com:CORRECT_USER/project
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.email=ID+CORRECT_USER@users.noreply.github.com
user.name=CORRECT_USER
And it looks good.
My /.ssh/config also has:
Host github.com-CORRECT_USER
HostName github.com
User CORRECT_USER
IdentityFile ~/.ssh/CORRECT_USER_KEY
So it looks good, too.
However, when I...
git push
I get:
ERROR: Permission to denied to TOTALLY_DIFFERENT_WRONG_USERNAME.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
What is happening that git is trying to push the right repo, with the right username, and the right ssh/config using the TOTALLY_DIFFERENT_WRONG_USERNAME? Where would that be set and how can I unset it?