Can't push to GitHub #21982
-
I’ve been using GitHub for a few years, although not for a little while until recently. I see now GitHub is deploying/has deployed 2FA and I have registered. That works. Today, though, I’ve found I cannot push my changes to origin: The requested URL returned error: 403 I’ve investigated further and found I needed a Personal Access Token (PAT). So I generated one for fetching and pulling from the remote. Still getting the 403. I did some more investigating and found I maybe should be inserting my username as part of the GitHub URL: remote.origin.url=https://ReggieMoto@github.com/ReggieMoto/my-repo.git. Tried that and still getting the 403. I’m certain this is all tied into the 2FA and the PAT somehow. I have all my credentials and am using them correctly, as far as I can tell. However: So, what’s going wrong? ReggieMoto |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Using the PAT instead of your password when pushing should be the only change you need. Does your token have the right scopes? For pushing you’ll definitely need the Scopes for OAuth Apps - GitHub Docs//docs.github.com/en/free-pro-team@latest/developers/apps/scopes-for-oauth-apps |
Beta Was this translation helpful? Give feedback.
-
Your remote origin spec format is wrong when using https there’s no user@. |
Beta Was this translation helpful? Give feedback.
-
Many thanks, airtower-luna. The missing component was the workflow. |
Beta Was this translation helpful? Give feedback.
-
Seems to work fine. It just doesn’t prompt me for my username since it’s already embedded within the URL. The problem was the missing workflow scope from the PAT |
Beta Was this translation helpful? Give feedback.
-
“Does your token have the right scopes? For pushing you’ll definitely need the repo scope …” OMG it took me SO LONG to find this one simple fact, and it made everything work. When you create your personal access token, click the box for repo — then use the token instead of password when you push, and it all works normally! Thank you, @airtower-luna!!! . |
Beta Was this translation helpful? Give feedback.
Using the PAT instead of your password when pushing should be the only change you need. Does your token have the right scopes? For pushing you’ll definitely need the
repo
scope, andworkflow
to add change Actions workflows.docs.github.com
Scopes for OAuth Apps - GitHub Docs
//docs.github.com/en/free-pro-team@latest/developers/apps/scopes-for-oauth-apps