I am on Mac OSX, git version 1.8.5.2 (Apple Git-48)
I had a git submodule in a git repo that had (to my knowledge) only ever been cloned, pulled, committed, merged and pushed using one git user and rsa key. I have many other pairs of users and keys but no others were specified in the ~/.gitconfig file.
When this submodule had the remote of https://github
... etc. It would allow me to commit with the correct username and email being applied but when pushing, would tell me that:
remote: Permission to some_username/project.git denied to user2.
fatal: unable to access 'https://github.com/some_username/project.git/': The requested URL returned error: 403
However when I removed the https://...
remote and instead used the git@github.com:some_username/project.git
remote, it works correctly.
Is this a bug with git or github? Was there any other way to fix it? Both these users have their associated rsa keys associated on their github accounts.