lily0225
lily0225

Reputation: 13

github push access denied to someone

I'm trying to push several files into my own repository on GitHub but my access was denied. Here's the message:

remote: Permission to lily0225/TravellingSalesmanProblem.git denied to ls3311.

fatal: unable to access
'https://github.com/lily0225/TravellingSalesmanProblem.git/': 
The requested URL returned error: 403

ls3311 is a friend whom I worked with on a previous project but we ended up not using GitHub.
I don't understand why my access was denied to her.

Upvotes: 1

Views: 1947

Answers (2)

VonC
VonC

Reputation: 1323223

Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.

No: the write aspect is only dependent on your GitHub right: owner of or collaborator on a GitHub project.
And that for https or ssh.

See "Permission levels for a user account repository".

So make sure your own GitHub account has been declared collaborator on your friend's repo.


remote: Permission to lily0225/TravellingSalesmanProblem.git denied to ls3311.

That means you are pushing to your own repo lily0225 with ls3311's credentials.

That happens when a credential helper has cached ls3311's credentials in association with lily0225/TravellingSalesmanProblem.git.
Check for a credential helper on your Git config:

git config -l | grep credential

On Windows, for instance, open your Windows Credential Manager and look for a github.com entry.

Upvotes: 1

Mirza Obaid
Mirza Obaid

Reputation: 1717

I also got the same problem and figured out what's cause.

Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.

So you need to change your repo config on your PC to ssh way:

edit .git/config file under your repo directory find url=entry under section [remote "origin"] change it from url=https://[email protected]/pakistan/lunch_call.git to url=ssh://[email protected]/pakistan/lunch_call.git. that is, change all the texts before @ symbol to ssh://git Save config file and quit. now you could use git push origin master to sync your repo on GitHub

Upvotes: 0

Related Questions