Github wrong username

I have setup with guthub with a previous github account on this computer called myaccount when i run this command

ssh -T
Hi myaccount! You've successfully authenticated, but GitHub does not provide shell access.

Ok but i have now setup a new github account called samaccount but i cant run this command i get this error.

  • How to safely change github account name?
  • Bitbucket different keys and accounts
  • Will changing my Github username to SnakeCase break anything?
  • PhpStorm. Two GitHub projects handled with different GitHub accounts
  • Github - I switched accounts and now I can't push because I have the wrong username
  • GitHub username change (with noreply as email for commits)
  • git push -u origin master

    i get this error

    ERROR: Permission to samueleast/Samuel-East-S3-Audio-Playlist-Player.git denied to myaccount.

    I dont want it to use myaccount it should be using samaccount !!!

    i have followed all the steps here
    setup brand new ssh key.

    and also run this command many times

    git config --global "samaccount"

    but it still uses myaccount its sooo annoying where am i going wrong???

  • Is it OK to merge another branch into mine and then merge both into master
  • Github - Git Push Error
  • How to update a pull request from forked repo?
  • Sending pull request for different issues-Github
  • Git is stonewalling me at every turn: I cannot commit to my project
  • rails + git + heroku - error on git push
  • One Solution collect form web for “Github wrong username”

    GitHub recognizes you as myaccount because SSH is using a key that corresponds to a public key that has been added to the myaccount account on the GitHub website.

    If you want to switch entirely to using the sameueleast account instead of myaccount, you can do the following:

    • Login to GitHub’s website as myaccount
    • Go to “Account Settings”
    • Go to “SSH Public Keys”
    • Delete your public key from that list
    • Logout
    • Login to GitHub’s website as samueleast
    • Go to “Account Settings” -> “SSH Public Keys”
    • Select “Add another public key” and paste in the contents of your public key. You public key will (probably) be called or and be in your .ssh directory.

    On the other hand, if you want to be able to use either myaccount or samueleast when pushing to GitHub, you will need to create aliases for in ~/.ssh/config, such as:

    Host github-myaccount
        User git
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/
    Host github-samueleast
        User git
        PreferredAuthentications publickey
        IdentityFile ~/.ssh/

    That assumes you’ve generated a second SSH keypair and given them names as above. Then you need to make sure that you are using the appropriate alias in the URLs of your git remotes. For example, if you want to change your origin remote so that pushing to origin means “pushing to origin as samueleast”, you could do:

     git remote set-url origin \
    Git Baby is a git and github fan, let's start git clone.