Home > front end >  Git push: The requested URL returned error: 403
Git push: The requested URL returned error: 403

Time:01-19

I am learning how to use Git github. I want to push my local repository to my git repository, I never did another one before. With console I configured with the user.name .user.password user.email the same as the one in GitHub. I created the local repository, I started git correctly, when I do git push origin master it asks me for username and password, I indicate them and it denies me access; After researching I found that I should create a token from my GH account, I created it, I tried the git push origin master and it denied me but this time it shows me the error: The requested URL returned error: 403

Try researching and entering the token; I hope you can tell me if I should make any configuration within my GH account or if I should modify the .config file

CodePudding user response:

Here are 3 auth options for push:

  1. Personal Access Token (classic)¹ - needs repo scope.
    Use the token value as the password
  2. Fine-grained personal access token - needs Contents scope plus make sure you select the correct repository it applies to when creating it.
    Use this as the password
  3. Install GitHub CLI and then $ gh auth login which should open the web browser.
    No explicit tokens here.

¹ There is some extra detail about https vs ssh but normally you don't need to worry about this.

  • Related