1

I am trying to set up git with a work account and a personal account. I'm quite new to git.

I am able to push to the work account, but when trying to push to the personal account, I get the following error:

ERROR: Permission to <personal_repo> denied to <work_github_username>.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

My ssh config looks like this:

# Personal account, - the default config
Host github.com-<personal_github_username>
   HostName github.com
   User git
   IdentityFile ~/.ssh/<name_of_personal_private_key_file>

# Work account
Host github.com-<work_github_username>
   HostName github.com
   User git
   IdentityFile ~/.ssh/<name_of_work_private_key_file>

If I do git remote -v I get: origin [email protected]:<personal_github_username>/<repo_name>.git (fetch) origin [email protected]:<personal_github_username>/<repo_name>.git.git (push)

Chessnut
  • 65
  • 5

0 Answers0