0

The error:

$ git push origin master
remote: Permission to CURRENTUSER/repo.git denied to OLDUSER.
fatal: unable to access 'https://github.com/CURRENTUSER/repo.git/': The requested URL returned error: 403

$ git remote -v
origin  https://github.com/CURRENTUSER/repo.git (fetch)
origin  https://github.com/CURRENTUSER/repo.git (push)
upstream        https://github.com/UPSTREAMUSER/repo.git (fetch)
upstream        https://github.com/UPSETREAMUSER/repo.git (push)

$ git config user.name
CURRENTUSER

I'm on Git for Windows (please don't shoot me it's not my choice). WHERE is OLDUSER coming from??? I can't find it anywhere. I've even done a complete uninstall of Git from my machine to no avail.

Also I've read a lot instructions and most people recommended resetting the keychain - but this isn't OSX, I can't find any help for windows.

Thank you!

MALON
  • 702
  • 1
  • 8
  • 20
  • Try running `git branch --set-upstream `, where is the correct https://github.com/user/repo.git/. I could be totally off here, but worth a shot right? – Lucas Watson Jul 15 '16 at 21:03
  • Git windows credential manager might be worth checking out. FAQ in the Readme have some clues on git Auth configuration that apply whether you're using it or not. https://github.com/Microsoft/Git-Credential-Manager-for-Windows/blob/master/README.md – GregHNZ Jul 15 '16 at 21:16
  • @LucasWatson I've done that like a hundred times, sorry. It's not even the upstream branch that's wrong, I'm unable to push to my own repo. – MALON Jul 15 '16 at 21:37
  • @GregHNZ According the "how to use" it just "magically works". But it's not helping me in this case. Any other ideas? – MALON Jul 15 '16 at 21:38
  • You could compare `git config --local user.name` with ` --global` but personally I'd go with the xkcd solution. Fresh clone to another folder with new credentials. Then some combination of git magic to generate a patch from the old one. (I acknowledge this is a cop out) – GregHNZ Jul 15 '16 at 21:46
  • @GregHNZ im really embarassed to post this, but can you watch this? https://www.twitch.tv/malonnnn/v/78228214 It's a video where I start from scratch and I still run into the error. Please tell me if I did something wrong. My mic is very quiet I didnt realize, but I'm very sorry you have to watch such a shitty video – MALON Jul 15 '16 at 22:00
  • Did you ever setup any SSH key?!! – dNitro Jul 16 '16 at 08:59
  • @dNitro He's using the "https://" form, so it should prompt him for a username and password on push. – Lucas Watson Jul 16 '16 at 20:42
  • @MALON It looks like some weird permission error is going on. I'd try first opening Git Bash *without* admin privileges. Also, you could try using [GitHub Desktop] (https://desktop.github.com/). Another cop out answer, but I find this works better for me when I have to use Windows. – Lucas Watson Jul 16 '16 at 20:44

0 Answers0