1

After forking a repo (Repo A) to Repo B, I've cloned a copy onto my PC using Git Desktop. I've then rolled back Repo B to an older commit using CLI and now want to push the change using Git Desktop. I keep getting a permission denied error.

I have added the lines for Windows 10 as per how to log out of one Github account and use another account? however it makes no difference, still having the same issue.

Running git push from the CLI and entering my credentials, I still get "! [remote rejected] master -> master (permission denied) error: failed to push some refs to'"

user1222302
  • 31
  • 2
  • 7

1 Answers1

1

First, make sure you are pushing to your fork (repoB), a repo that you own.

Second, make sure the master branch is not protected against push.
And make sure to use a git push --force, if you have reset your branch to an older commit.

The OP confirms in the comments:

The repo was created with a new account and I'm still logged into the desktop with my personal account

The idea for pushing to a fork remains to push to a repo that you own. The account must match.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250