how do I get around the 403 error when trying to push files to a repository on github?

Viewed 23

I see the following error message (Windows, Powershell)

PS C:\Users\family\Desktop\index.html> 
  git push origin main
  remote: Permission to assylum6/assignment1.git denied to AlvaroMakobi.
  fatal: unable to access 'https://github.com/assylum6/assignment1/': 
    The requested URL returned an error: 403
1 Answers

Check first, in a git bash session (not Powershell) if you have cached credentials:

git config --global credential.helper
xxx  <=== take note of that value

# replace xxx by that value
printf "host=github.com\nprotocol=https" | git credential-xxx get    

If AlvaroMakobi is your GitHub account, then you don't own assylum6/assignment1, and you possibly need to fork that repository in order to push to your fork (using HTTPS or SSH).

Related