Unable to write/push to personal repo (403)


I am running into some issues pushing any code whatsoever to my github account, be it already existing repo edits or completely new repos.

i am using a new personal access token as the password, and regardless of where I am trying to push code (the following snippet was from a newly created empty repo I used to test whether I can even push a txt file), I keep getting the following error:

remote: Write access to repository not granted.
fatal: unable to access ‘https://github.com/username/repo_name.git/’: The requested URL returned error: 403

All repos I’m trying to push to are created by me, so I’m assuming I do have write permissions. I tried finding where I can edit read/write permissions but the only thing I found was adding collaborators.

Important note: I recently changed the email associated with my account so maybe it has something to do with that? If so, how do I resolve this issue?

Thanks in advance!

1 Like

Is that the full output of the push command, or was there anything else? The quoted part seems a little short. :sweat_smile:

As long as they’re in your account that’s reasonable. :slightly_smiling_face:

Sorry for not clarifying – it’s from the push command!
For reference, I made a test repo on github, then I made just a txt file in a local directory and ran:

git init
git remote rm origin
git remote add origin <github_repo_link>
git add .
git commit -m “test commit”
git branch -M main
git push -u origin main

And the snippet you inquired about is the output from the last push command. It asked me for username and password, for which I entered mindrealms and pasted the access token.
( Ah, sounds good regarding the permissions, thanks! :slight_smile: )

The commands should work. Which scopes has the PAT you’re using? In particular, does it have the repo scope?


OH thank you so much I thought I those were checked by default. That worked! Have a great day!