How can I run git push/pull commands with SSH verbose mode?

Put this in your ~/.ssh/config file:

Host <git-server-FQDN> LogLevel (QUIET|FATAL|ERROR|INFO|VERBOSE|DEBUG|DEBUG1|DEBUG2|DEBUG3)

Subsequent git commands that interact with the server should produce desired debug output.


From Git version 2.3.0, you can use the environment variable GIT_SSH_COMMAND and pass the -v verbose argument like this:

GIT_SSH_COMMAND="ssh -v" git clone <REPO_SSH>

you can also pass -vvv for even more verbose level:

GIT_SSH_COMMAND="ssh -vvv" git clone <REPO_SSH>

(as seen here https://askubuntu.com/a/620985/975188)

note that you can also run this with other git commands, such as git push, git fetch etc.

From Git version 2.10.0, you can even configure this per repo or globally:

git config core.sshCommand "ssh -v"
git pull
git push

Tags:

Git

Ssh