0

I'm getting following error

remote: Permission to sokratus/xxxxxxxxxxxxx.git denied to user-name2.
fatal: unable to access 'https://github.com/sokratus/xxxxxxxxxxxxx.git/': The requested URL returned error: 403

The user-name2 belongs to one of my friend and I'm not sure why is it coming up on my computer.

1

3 Answers 3

3

This is because you are trying to push to your friend's repository & you do not have permission to do so. This is probably what you did:

git clone https://github.com/sokratus/xxxxxxxxxxxxx.git/
## did something, git add or git commit....
git push 

By default, git push pushes to the origin, you can check the repository to which origin points to by doing :

$ git remote -v
# which will give you something like this
origin https://github.com/sokratus/xxxxxxxxxxxxx.git/ 

If you want to push to the origin, then you need access to it. Or if you want to push it to your own github repository, then you need to create a new remote, like this:

$ git remote add my_origin <your github repository's url>
$ git push my_origin 
5
0

Solved it! Apparently 'user-name2' of my friend was saved with password in my Keychain for github.com. I deleted those entries from Keychain and now the problem is solved! Thanks Upasana for all the help anyways. :)

0

You can fix your repo by pasting this on your terminal:

$ git remote set-url origin [email protected]:usename/repository_name.git

This worked for me

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.