git pushes with wrong user from terminal

前端 未结 22 1401
夕颜
夕颜 2020-12-07 07:51

I have an issue with git and my terminal.

Here\'s a gallery to show you my issue : http://imgur.com/a/6RrEY

When I push commits from my terminal, git says I

相关标签:
22条回答
  • 2020-12-07 08:17

    In my particular case, the issue was that I was using a .netrc to access github.com and it was configured with a token from a different user:

    machine github.com login <another-user-token>
    
    0 讨论(0)
  • 2020-12-07 08:17

    What worked for me removing the repo and adding it again:

    git remote rm origin
    git remote add origin git@github.com:fguillen/MyApp.git
    
    0 讨论(0)
  • 2020-12-07 08:17

    I had a similar issue while running git via Remote SSH inside of Visual Studio Code. Turns out that VSCode by default sets itself up as authentication handler and sets $GIT_ASKPASS to a script ($HOME/.vscode-server/bin/*/extensions/git/dist/askpass.sh), which it uses to set/override git credentials.

    This can be overridden by setting git.terminalAuthentication to false (aka. Git: Terminal Authentication) and effectively removes the $GIT_ASKPASS environment variable from the terminal.

    0 讨论(0)
  • 2020-12-07 08:19

    I have the same problem in windows10 even after uninstall my git, as @user542833 says it is because windows cache and you should remove Github credentials in your windows Credential Manager and when you again attempting to push, windows ask your credential and set it again

    0 讨论(0)
提交回复
热议问题