Ankur Agarwal
Ankur Agarwal

Reputation: 24778

Git config issue and git push error

I have --global git config under ~/.gitconfig

has email1

and

I also have --local git config under a git repo's .git/config

has email2

Both have different emails.

Now when I push to my remote repo from under the repo clone that has --local config I get an error saying "remote: Permission to abc/def.git denied to email1."

Why so and how can I fix this ?

I am using https github url's so don't have ssh keys set up or added to github.

git config --get user.email

shows email2 when run under the clone of remote repo.

shows email1 when run from my ubuntu home directory

git config --get-all user.email

shows both email1 and email2 when run under the clone of remote repo.

shows email1 when run from my ubuntu home directory

Upvotes: 0

Views: 97

Answers (1)

Ilion
Ilion

Reputation: 6882

It's likely that you have credentials stored in your credential helper. You should try invalidating them. You can also review all your current config settings with the command:

git config -l

Upvotes: 1

Related Questions