title: Github - I switched accounts and now I can't push because I have the wrong username
body: <p>So I'm now "jononomo" on github.  A year ago, however, I was "zononomo".  I quit software for a while and bought a new laptop in the interim.  Then I came back and created a new account on Github under the handle "jononomo" and now I'm trying to sync my dotfiles between my two laptops.  From my new laptop I created a git repository and pushed it up to github where it can be viewed under the "jononomo" account.  Then I went to my old laptop and cloned this repository.  Everything worked as expected.</p>
  
  <p>Then I made some changes to my dotfiles on my old laptop and now I'd like to push these changes to github so that I can then pull them down to my new laptop.  The problem is that when I run the command:</p>
  
  <pre><code>git push origin master
  </code></pre>
  
  <p>I get the error message:</p>
  
  <pre><code>ERROR: Permission to jononomo/.dotfiles.git denied to zononomo.
  </code></pre>
  
  <p>The first thing I did was blow away my old SSH keys in <code>~/.ssh/id_rsa</code> and <code>~/.ssh/id_rsa.pub</code>.  Then I generated new SSH keys and added my new public key to my jononomo github account.  But that didn't fix the problem.  If I run the command:</p>
  
  <pre><code>ssh -T git@github.com
  </code></pre>
  
  <p>I get the response:</p>
  
  <pre><code>Hi zononomo! You've successfully authenticated, but GitHub does not provide shell access.
  </code></pre>
  
  <p>Next, I followed the solution given here: <a href="https://stackoverflow.com/a/8152291/1701170">https://stackoverflow.com/a/8152291/1701170</a>  This person suggested that I create a <code>~/.ssh/config</code> file with the following contents:</p>
  
  <pre><code>Host github-jononomo
      User git
      Hostname github.com
      PreferredAuthentications publickey
      IdentityFile ~/.ssh/id_dsa.pub
  </code></pre>
  
  <p>and then he suggested I run the command:</p>
  
  <pre><code>git remote set-url origin git@github-jononomo:jononomo/.dotfiles.git
  </code></pre>
  
  <p>I tried that, but it didn't fix my issue.  I'm still getting the message:</p>
  
  <pre><code>ERROR: Permission to jononomo/.dotfiles.git denied to zononomo.
  </code></pre>
  
  <p>Incidentally, my <code>.gitconfig</code> has the following contents:</p>
  
  <pre><code>[user]
      name = Jon Crowell
      email = me@myemail.com
  [github]
      user = jononomo
      token = 2a18a7235746324aefec34b234aa343a
      email = me@myemail.com
  [credential]
      helper = osxkeychain
  </code></pre>