1

Whenever I type:

git push

I get:

remote: Permission to [username]/[project-name].git denied to [old-username].
Fatal: unable to access [https://github.com/link/.git]: the requested url returned error: 403

I think that git tries to push using [old-username] which is a github account I don't use for this project.

I'm new to git but I can't seem to find the solution. How can I get github to prompt me for my correct username and password so I can push to the remote branch my new account has access to?

4
  • git config --global user.email [email protected] Commented May 1, 2017 at 16:16
  • Doesn't work. I should note that (Because I didn't notice it) one of my previous commits were done under my old username / mail. But my newest commit is done under my new name / mail Commented May 1, 2017 at 16:24
  • Does this help? Commented May 1, 2017 at 16:59
  • No, I think that is for a different issue and it recommends the use of ssh. For now I decided to unset my credential helper using "git config --global --unset credential.helper" I'm not sure if this will wipe my old credentials as well (hopefully), but I will figure that out on a later schedule. In the meantime I will just manually input everything. Commented May 1, 2017 at 17:09

1 Answer 1

1

You can change your remote url to include your username and/or password

git remote origin set-url https://[email protected]/username/repository.git

With also your password

git remote origin set-url https://username:[email protected]/username/repository.git
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.