I recently created a second GitHub account that shared my work and my private projects (I used to have only a work account). I use https in conjunction with the Windows credential store. To automatically select the correct account, I save my personal account information in ~/.gitconfig
and my work account information in ~/work/.gitconfig
, as suggested here .
Unfortunately, when I try to make changes to my private repositories, I get the following error:
$ git push
remote: Permission to privateuser/privaterepo.git denied to workuser.
fatal: unable to access 'https://privateuser@github.com/privateuser/privaterepo.git/': The requested URL returned error: 403
I set the remote url git remote set-url origin https://privateuser@github.com/privateuser/privaterepo.git
like the one suggested here . Clicking on my repo work is still working fine. And when I type git config user.name
in my personal / work repositories, I get my personal / work username, respectively, as it should be.
What is the problem with the new private repositories? Why does git still think that I am workuser
when I try to click on my personal repositories? Do I need to do something with the Windows credential storage that I used to store my credentials? He never asked for the password of my personal account ...
CGFoX source
share