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 deleted my files. Can they be recovered?
  • i like to add the AOSP 4.3 to a gerrit project
  • On git line-endings again
  • Git Error Commit History
  • Setting up production/development environment in Laravel
  • Exclude commits from Git hooks?
  • 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)?



  • Undo git pull, how to bring repos to old state
  • Remove file from the repository but keep it locally
  • “” -> master (pre-receive hook declined)
  • Brew cannot find git, even though git in path (Mac/OSX)
  • git submodule update and authentication
  • Cloning github repo with hggit
  • 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.