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 
Sign up to request clarification or add additional context in comments.

5 Comments

No but the repo is mine. I created it with my own account. I didn't use git close at all.
Could you please paste the output of "git remote -v"?
Sokratus:SokratusPortfolio Sokratus$ git remote -v origin github.com/sokratus/xxxxxxxxxxxxx.git (fetch) origin github.com/sokratus/xxxxxxxxxxxxx.git (push)
Then I think this is for you stackoverflow.com/questions/13308602/… (as the other person commented above)
I can push it to my repo now, I added the 'user-name2' as a collaborator for that project. But all the pushes I'm doing are showing up as done by 'user-name2'.
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. :)

Comments

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 Comment

How do I write a good answer?. This provided answer could benefit from an explanation.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.