Page History

Turn Off History

Git on Windows

(from drupal 1434 (backup) 1434 (public))

Install Git

Install Git for Windows from http://code.google.com/p/msysgit/. Note you just want to grab Git, not msysGit.

When you clone a repository, you will want to use the following syntax: git clone ssh://tannenba@chevre.cs.wisc.edu/p/condor/repository/CONDOR_SRC.git

Since Git includes an ssh.exe in its bin/ directory, you should be good to go -- but you will have to enter your ssh password whenever you git clone/pull/push/fetch, or otherwise do comparisons against the origin. If you want to set things up so you do not have to enter your password each time, read on.

Setup to use Git without passwords like Todd does

  1. Download plink.exe (google it). This is a nice, free, full-featured command link ssh client for Win32.
  2. Grab puttygen.exe (google it) and use it to create a public/private keypair and add the public key into your authorized keys as instructed here. Don't protect your private key with a passphrase; instead, store your keys on your Windows machine in ~/.ssh2 (or wherever) and right select on that folder. Then (at least on XP), click on the Advanced button near the folder Attributes and place a check mark next to Encrypt contents to secure data.
  3. Test that you can now ssh w/o a password by entering something like:
    plink.exe -2 -C -i c:\home\tannenba\.ssh2\putty.ppk %1 "/bin/date"
    
  4. Now set the GIT_SSH environment variable to be gitssh.bat, which is provided below. This batch file will rewrite that command git wants to run so that runauth is used (to get an AFS token) and also so that the correct version of Git in /unsup/git is used.
    @echo off
    set withquotes=%2
    set noquotes=%withquotes:"=%
    c:\utils\sshcvs\plink.exe -2 -C -i c:\home\tannenba\.ssh2\putty.ppk %1 "/s/std/bin/runauth /unsup/git/bin/%noquotes%"
    
  5. You will need to run stashticket once a month on whatever machine you ssh into.

Attachments: