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

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

#1

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


#2

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.


#3

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.


#4

@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.


#5

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


#6

thank you so much. I resolved my problem