Skip to content

Debugging Git Over Ssh

Creating keys

See the existing article for guidance.

Debugging

Increase verbosity

Start by adding verbosity to your git commands:

You can use between 1 and 3 v’s to increase or decrease verbosity

Dos

set GIT_SSH_COMMAND=ssh -vvv
git clone ssh://bitbucket/repo

Powershell

Terminal window
$env:GIT_SSH_COMMAND="ssh -vv"
git clone ssh://bitbucket/repo

Bash

Terminal window
GIT_SSH_COMMAND="ssh -vv" git clone ssh://bitbucket/repo

Validate the key being used

In your output check for the following sections, often times you will find that different Git tool use different .ssh directories and this will lead to the greatest number of issues. Gitbash will use U:/.ssh while other tools will use C:/users/username/.ssh.

If you see a key being offered that has not been added to Bitbucket either remove it or add it into Bitbucket’s web interface.

debug1: Reading configuration data <path>
debug1: Found key in <path>
debug1: Trying private key: <path>
debug1: Offering public key: <path>