0

I have read through multiple questions addressing this problem, but none of the solutions work for me. I have changed the user.name and user.email of my local repository, yet when pushing it doesn't work. Here is what my terminal looks like:

$ git config --local user.name "myusername"
$ git config --local user.name
myusername
$ git config --local user.email "[email protected]"
$ git config --local user.email
[email protected]
$ git push
remote: Permission to myusername/myusername.github.io.git denied to otheraccount.
fatal: unable to access 'https://github.com/myusername/myusername.github.io.git/': The requested URL returned error: 403

1 Answer 1

1

It looks like you're using a credential manager and it has credentials stored for a different account. Those credentials are being used when you push, and the other account doesn't have access to that repo.

If you do have multiple accounts and want to use both, then you should use the technique outlined in the Git FAQ (there's also one for SSH). If you just have credentials you don't want to use anymore, then you should use the technique outlined in the Git FAQ to do that. Note that the latter technique is broken for Git Credential Manager for Windows, and you should see their issue tracker for a workaround.

You should also note that user.name has no effect on authentication whatsoever. It is instead the name that you place in your commits, and is by convention a personal name (that is, the name other humans call you). Git permits it to be almost any value, so a username is permitted but not customary.

Sign up to request clarification or add additional context in comments.

Comments

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.