Setting up a Git Server on Windows Server 2008 R2 (using msysgit and WinSSHD) [Update]

This is a follow-up post from this one. It is inspired by a comment from Dan Kendall. So thanks Dan.

In the portable version of msysgit the git-upload-pack.exe and the git-receive-pack.exe files are also located in the bin/ folder. This allows us to shrink the configuration down and even skip all configuration steps on the client.

The basic setup is the same as in the original post.

The server configuration is a bit different though.

1. Download the portable version of msysgit and extract it to C:\Git.

2. Add C:\Git\bin to the PATH variable.
(If you don’t want to use the portable msysgit for whatever reason, you also have to add C:\Git\libexec\git-core to the PATH)

3. Create a new file in C:\Git\bin and just insert

$*

Save it as shell script (.sh). E.g. “gitcmdhelper.sh”.
This basically executes the all parameters that are passed and solves the quotes-problem that is mentioned in the original post. There are surely other approaches to solve this issue and if you find a better one please do not hesitate to post a comment.

4. In WinSSHD open the advanced settings and edit the user account(s) you have set up before. Scroll down a bit and uncheck “Use group default exec request prefix”. Then change the “Exec request prefix” to

cmd.exe /c sh gitcmdhelper.sh 

Be sure to add a space at the end.

5. Done. You can connect to the server with your Git client.

git clone|push|pull|etc. ssh://username@server/path/to/myrepo 
Advertisements
%d bloggers like this: