0
votes

I have installed git, made a git repository and successfully pushed files from there onto my github account. I initiated another git repository with other contents and from there wanted to push onto another github account:

git remote add github <https://...>
git push github master`

This had worked for the first account and repository but when I tried this for my second repository and account it didn't work:

remote: Permission to [2ndAccountName]/[2ndRepositoryName].git denied to [FirstAccountName].
fatal: unable to access 'https://github.com/[2ndAccountName]/[2ndRepositoryName.git/': The requested URL returned error: 403

After having failed to correctly modify the settings so that I can push onto multiple github accounts on one computer I reinstalled git and just wanted to use the 2nd account. The github repository for the second account is still empty and I wanted to push files up there but the same error message was shown.
I just want to push the files onto my 2nd github account.
How does git still remember my FirstAccountName(although I uninstalled and reinstalled it) and how can I delete it so that it will allow me to push onto my second github account?
Setting the global user.name and user.email didn't solve this. I use git bash.

1

1 Answers

0
votes

this worked for me:

  1. download and install Github Desktop
  2. sign in in 2nd Github account over Github Desktop gui
  3. add the repository of the 2nd project over gui
  4. delete empty repository on github
  5. publish the repository over gui(makes a new remote repository for the 2nd local repository and let's you name it)
  6. press sync in the gui which will in this case push the files to the remote repository on github (see: What does GitHub for Windows' "sync" do? for more backround on sync)