Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git permission denied but for different user

I was trying to setup a repo with an existing files. So I followed the simple instructions from the source but on the last step when I try to push, I got this error;

remote: Permission to abc/abc.git denied to [email protected].
fatal: unable to access 'https://github.com/abc/abc.git/': The requested URL returned error: 403

So then I checked the current user by outputting the command;

git config user.email

which yields a different email from the error above. Also, tried authenticating into github which went successful with the command below.

ssh -T [email protected]

I only have one ssh-key and ssh-agent is also defined.

Any suggestions on how to further debug? Why is it using the oldemail instead of the current one?

Thanks!

P.S. I'm on a mac running yosemite.

like image 458
admiralqxcvii Avatar asked Jul 22 '15 08:07

admiralqxcvii


1 Answers

It would appear that you are attempting to connect with an email that GitHub does not recognise/associate with your account.

You can either:

A) Change the email address using git config, https://help.github.com/articles/setting-your-email-in-git/ to the email address associated with your github account.

B) Add the email address returned from the 'git config user.email' here: https://github.com/settings/emails

Also ensure that you do have write access to the repo you are trying to push to

like image 192
Peter Reid Avatar answered Sep 30 '22 20:09

Peter Reid