Git SSH

I am a long time Subversion user, TortoiseSVN primarily. For version controlling projects with a small local team, I believe it is still the best choice to get off the ground quickly. With a virtually zero learning curve (Right click->Update, Right click->Commit, auto-save passwords, etc). it is ideal for developers new to the concept of version control (i.e. most of the ones I have managed).

I’ve been using Git exclusively now for about 6 months, command line and TortoiseGit. Git is without a doubt a superior VCS to SVN, but does come with a learning curve. Today, I hit another learning curve obstacle.

Goal: Perform remote git operations without always having to enter the password for both TortoiseGit and command line.

Configuring TortoiseGit is semi-easy (semi-easy because I had to Google it):

  • Run “%ProgramFiles%\TortoiseGit\bin\puttygen.exe”.
  • Generate and save .ppk file.
  • Add the public key to your GitHub, BitBucket, etc online repo.
  • Add the path to the .ppk file under Git->Remote->origin->Putty Key.
  • Make sure “Autoload Putty Key” is checked in any dialog.

Unfortunately, the above may not be enough to make the command line version of git.exe work without a password.

For my setup, I had to add an environment variable “GIT_SSH” and set it to the same SSH client that TortoiseGit uses which for me is:

C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe

TortoiseGitSsh

 

So, from a command line just run:

setx GIT_SSH “C:\Program Files\TortoiseGit\bin\TortoiseGitPlink.exe” /m

I still miss calling “svn up”, for which this is no direct Git substitute, but now I can at least call “git pull” without entering a password.

Leave a Reply

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