So, I am now "jononomo" on github. A year ago, however, I was "zonomono." For some time I quit the software and bought a new laptop. Then I came back and created a new Github account under the "jononomo" handle, and now I'm trying to synchronize my dotfiles between my two laptops. From my new laptop, I created a git repository and moved it 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.
Then I made some changes to my dotfiles on my old laptop, and now I would like to forward these changes to github so that I can then transfer them to a new laptop. The problem is that when I run the command:
git push origin master
I get an error message:
ERROR: Permission to jononomo/.dotfiles.git denied to zononomo.
The first thing I did was knock down my old SSH keys in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub . Then I generated new SSH keys and added my new public key to my jononomo github account. But this did not solve the problem. If I run the command:
ssh -T git@github.com
I get the answer:
Hi zononomo! You've successfully authenticated, but GitHub does not provide shell access.
Next, I watched the solution given here: https://stackoverflow.com/a/4646266/ ... This person suggested creating a ~/.ssh/config file with the following contents:
Host github-jononomo User git Hostname github.com PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa.pub
and then he suggested running the command:
git remote set-url origin git@github-jononomo :jononomo/.dotfiles.git
I tried this, but this does not fix my problem. I still get the message:
ERROR: Permission to jononomo/.dotfiles.git denied to zononomo.
By the way, my .gitconfig has the following contents:
[user] name = Jon Crowell email = me@myemail.com [github] user = jononomo token = 2a18a7235746324aefec34b234aa343a email = me@myemail.com [credential] helper = osxkeychain