2

I have a problem when I try to push to a repository I have made.

I created a repository, and now I'm trying to commit and push files to that repository.

But I get an error that says

"Remote: Permission to {link} denied to {notmyname}
fatal: unable to access {link}: the requested URL returned error: 403
Git did not exit cleanly (exit code 128)"

When I go into settings, under "info" my name and email are correct.

But in the error code it displays a name which once had been used, but not anymore.

How do I change this? How do I fix the error?

I have not been able to find a solution using Google so far.

MrTux
  • 28,370
  • 24
  • 91
  • 123
andrelange91
  • 707
  • 2
  • 10
  • 31

2 Answers2

2

The user information under TortoiseGit -> Git "Info" is only used as meta data for commits and not for authentication.

In your case it seems as if old credentials were saved which are used right now.

If it's a http/https URL and you use a credential store (what I assume), you can see here which credentials are used and reset them.

Generally it depends on which protocol you use, http/https or ssh. See https://stackoverflow.com/a/41292048/3906760.

Community
  • 1
  • 1
MrTux
  • 28,370
  • 24
  • 91
  • 123
1

Try if this works: Change your repo config on your PC to ssh way:

  1. Edit .git/config file under your repo directory.

  2. Find url=entry under section [remote "origin"]

  3. change it from url=https://user@gitUrlLocation/yourgitUrl.git to url=ssh://user@gitUrlLocation/yourgitUrl.git. that is, change all the texts before @ symbol to ssh://git

  4. Save config file and quit. now you could use git push origin master to sync your repo on GitHub

Sanjit Kumar Mishra
  • 1,083
  • 10
  • 32