poor content

not useful

useful

very useful

excellent

Rate

January 23, 2022

Alireza Ataei

By: Alireza Ataei

Git pushes with a wrong user and permission fails

Reading time: 4 min

    Content List

It sometimes happen that you are trying to push to a remote git repo but it says the permission is denied on a user that you are not even actually trying to authenticate with, here are two solutions

First of all, check your local and global configs on git in your projects terminal, see if they are set as what you expect by:

For local configs

git config user.name

git config user.email

 

For global configs

git config – -global user.name

git config – -global user.email

If the local is not the user your trying to push with, then change them with:

git config user.email “your@email.com”

git config user.name “your name”

 

If they are alright, or changes did no good, then you should check you key chain credentials

On windows, head to

  1. control panel
  2. user accounts
  3. manage your credentials
  4. windows credentials

Look for a row saying git:https://github.com or any other gitlab for example if that’s what you’re looking to fix
After finding it, remote the row through the dropdown at the very right side of the row

Now head back to your terminal and push again, you will be asked to sign in to your GitHub, complete the sign in and you should be good to go.

Was this page helpful?

What was the most helpful point of this page for you?

Thanks for your cooperation!

poor content

not useful

useful

very useful

excellent

Comments0

Leave a Reply

Your email address will not be published.