Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 951
cowlinator Avatar asked Nov 15 '17 22:11

cowlinator


People also ask

What is verbose mode with SSH?

In verbose mode, the client prints messages as it proceeds, providing clues to the problem. New SSH users (and quite a few experienced ones) frequently forget or neglect to use verbose mode when problems arise.

Can I run Git commands on Windows?

The Windows Explorer integration > Context menu entries option allows opening the Git command prompt (Git Bash) from any folder by clicking with the right mouse button on the folder and selecting Git Bash Here. The last option is also interesting in that it installs a better font for all console windows.

What is verbose in Git?

According to the manual ( git commit --help ): -v , --verbose. Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has.

How does Git know SSH key Windows?

Once your key is open, you want to select Conversions -> Export OpenSSH key and save it to HOME\. ssh\id_rsa . After you have the key at that location, Git Bash will recognize the key and use it.


2 Answers

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
like image 186
VonC Avatar answered Oct 01 '22 01:10

VonC


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.

like image 44
cowlinator Avatar answered Oct 01 '22 03:10

cowlinator