Git thinks I'm a different user, won't give me access to github repo

I had an account on github (Mariogs37) that I’ve since stopped using. In the meantime, I’ve created a new one (bclayman) that I’d like to start using. I created a repo on github and ran:

git remote add origin

I get no error messages, and then I run:

git push -u origin master

However, I get this error message:

remote: Permission to bclayman/SquashScraper.git denied to Mariogs37.
fatal: unable to access '': The requested URL returned error: 403

I googled around for similar issues and came across this link:

I followed vonC’s answer’s instructions (here: At the end of adding my SSH key to github, I got this in my terminal:

Hi bclayman! You've successfully authenticated, but GitHub does not provide shell access.

I retried pushing my local repo to github but have run into the same error. Any idea why it still thinks I’m Mariogs37 (and thus don’t have permissions to push to a repo on github owned by bclayman)?



  • How do I add an empty directory in Git?
  • “git filter-branch” successfully used to change committer/author, but changes don't reflect on github
  • git clone timed out when used through https proxy
  • omnibus or source - can't decide which one to use for gitllab backup/restore
  • GitHub for Windows : how to unset svn-remote.svn.url
  • Adding project back under git control?
  • Contributions not showing up under Github profile?
  • git branch - local or what?
  • 2 Solutions collect form web for “Git thinks I'm a different user, won't give me access to github repo”

    This most likely is a misunderstanding in what credentials are used for what.

    GitHub offers you to use two different protocols to access your repo:

    • HTTPS
    • SSH


    This one uses the ssh keys and settings in your ~/.ssh folder. It is used if you add a remote like this:

    git remote add origin

    HTTPS (the one you chose):

    This one uses the https credentials that depending on your system could be stored in various places (if at all). As it seems you’re using the OS X Keychain, so they are most likely stored there. The https protocol is used if you add a remote like this:

    git remote add origin

    So to get this resolved i’d open your OS X Keychain and search for and delete all items that come up. Next time you try to push / fetch it should ask you for your username and password again.

    Did you try below?

    git config --global "bclayman"
    git config --global "email_addr_of_bclayman"

    And also make sure under your ~/.ssh folder, no ssh key related to Mariogs37, if any, delete them. Only keep ssh key of bclayman.

    Git Baby is a git and github fan, let's start git clone.