git pushes with wrong user from terminal

前端 未结 22 1463
夕颜
夕颜 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

    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.

提交回复
热议问题