Need your help with github: permission denied to my own repo

Hi guys,

This is very weird. I’ve used github before on this computer. Nothing changed, no username of other account info but I can’t push any files to my repos anymore.

This is what I do when I create a new repo:

cd path/to/project
git init
git status
git add .
git commit -m ‘First commit’
git log

==
github: create a new repo with readme. Copy url

==
git remote add origin https://github.com/MrsColombo/elsevier-twitter-rest-api.git
git push -u origin master

remote: Permission to MrsColombo/elsevier-twitter-rest-api.git denied to JuliaRietveld.
fatal: unable to access ‘https://github.com/MrsColombo/elsevier-twitter-rest-api.git/’: The requested URL returned error: 403

Why do I get this error? When I do git config user.name I get MrsColombo.

I appreciate your help very much.

Julia

1 Like

I generated a new SSH key, copied it to clipboard and pasted in on github > settings > SSH keys. I get an error that this key already exists.

Then in my terminal I did this eval “$(ssh-agent -s)” and this ssh-add ~/.ssh/id_rsa. I get a message that Identity is added.

But when I do this: it push -u origin master

I get the same error:
remote: Permission to MrsColombo/elsevier-twitter-rest-api.git denied to JuliaRietveld.
fatal: unable to access ‘https://github.com/MrsColombo/elsevier-twitter-rest-api.git/’: The requested URL returned error: 403

I’m starting to hate github. This stuff is public so why do they make it so hard?

Thank you in advance for your help.

The thing to hate for being overcomplex and hostile is git itself, not Github. And there’s not much defense I can give for git, it really is that bad. Do this to fix your repo:

git remote set-url origin git@github.com:MrsColombo/elsevier-twitter-rest-api.git

In the future, clone your repos using ssh and not https, and they’ll always be writable. You can get the ssh url from the green “clone or download” button. Alternatively, use the github desktop app, which uses your ssh keys by default.

11 Likes

@MrsColombo I had this problem too but managed to solve it, the error is that ur computer has saved a git username and password so if you shift to another account the error 403 will appear. Below is the solution
For Windows you can find the keys here:

control panel > user accounts > credential manager > Windows credentials > Generic credentials

Next remove the Github keys.

24 Likes

@chuckadams, thanks for ur solution. Your command solved my one day research on the above error.

2 Likes

thank you so much. I resolved my problem

1 Like

@ruddy12 Thank you! This solved my problem.

1 Like

Thanks bro , solved with your answer

1 Like

thanks alot…

2 Likes

@ruddy12 Thanks a lot. Resolved my issue

1 Like

Two years later, and your comment is still saving lives out here. Thank you.

1 Like

I have been working on this since 1hr and the fix really worked. Thank you @chuckadams :slight_smile:

Thanks, it solved my problem

1 Like

Thanks man! I knew it had something to do with this because I had another GitHub account saved in my PC.

Awesome ruddy You Give Me The Perfect Solution

thank you bro…thank you

Thanks @chuckadams this worked for me .

thank you very much ,I solve my problem.

Awesome!!! You’re the savior :raised_hands:

wow… now it works properly…
Thanks alot bro ^^