How can I run git commands on Windows with SSH verbose mode?

余生长醉 提交于 2019-12-07 08:04:10

问题


This is the Windows version of How can I run git push/pull commands with SSH verbose mode?

There are times where you just need to debug git's usage of SSH.

OpenSSH has a -v flag for verbose output, but how do you get git to use it?

How can I run git commands on Windows with SSH verbose mode?


回答1:


If your PATH is correctly set:

  • you don't need OpenSSH-Win64 (ssh is already included in Git)
  • you don't need to specify the full path for SSH

You need:

set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%

Then

set GIT_SSH_COMMAND=ssh -vvv



回答2:


You can force git to provide verbose ssh output with the "GIT_SSH_COMMAND" environment variable.

For example, to get verbose output from OpenSSH-For-Windows for a git clone command, just open a command prompt and enter

set GIT_SSH_COMMAND="C:\Program Files\OpenSSH-Win64\ssh.exe" -vvv
git clone <repo_ssh_url>

Note the location of the quotation marks.



来源:https://stackoverflow.com/questions/47318691/how-can-i-run-git-commands-on-windows-with-ssh-verbose-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!