Git on Windows: Debugging Problems With Msysgit

Getting git working on Linux is really simple: apt-get install git, ssh-keygen –t rsa –C “[email protected]”, cat ~/.ssh/id_rsa.pub, copy to clipboard, paste in your git repo host, ssh [email protected] (accept the new host key), git clone [email protected]:/yourproject.git, bam, done.

 

Getting it working with Windows can be a right sod. Or it can be equally simple if you’ve not already tried loads of different methods, leaving loads of other conflicting apps installed.

The Good:

If you follow the github Windows setup tutorial you’ll be pretty much there already.

The Bad:

If you’ve already installed things such as TortoiseGit and PuTTY you may see some confusing errors.

Those along the lines of

[bash]FATAL_ERROR Disconnected: No supported authentication methods available[/bash]

or

[bash]FATAL_ERROR The remote end hung up unexpectedly[/bash]

are usually related to your public key not being correctly used in the connection.

If you can ssh correctly to the repo I found that this can happen if you have the wonderful PuTTY installed and have pageant (key manager) running somewhere, forcing msysgit to use pageant as the key manager instead of OpenSSH (assuming you selected the OpenSSH option in the msysgit installation).

Some say to update the GIT_SSH environment variable (I didn’t have one to delete, so this didn’t help me much). I ended up deleting PuTTY (overkill) and Pageant and ensuring no related processes were running.

 

If you get errors along the lines of “access denied” when you try to view or delete a repo:

Following the answer to this SO post; the first step is to see what is locking the file. Pop over to sysinternals and make sure you have the wonderful Process Explorer to hand.

You’ll most likely find that the process in question is TGitCache – a process related to TortoiseGit. Kill the process and uninstall if you don’t use it.

HTH

Leave a Reply

Your email address will not be published. Required fields are marked *