Here are some steps you can follow to get the git daemon running under Windows:
(Prerequisites: Cygwin with the packages git and cygrunsrv installed)
Step 1: Open a bash shell
Step 2: In the directory /cygdrive/c/Cygwin/usr/bin/, create a file named "gitd" with the following content:
#!/bin/bash
/usr/bin/git daemon --reuseaddr --base-path=/git --export-all --verbose --enable=receive-pack
Step 3: Run the following cygrunsrv command to install the script as a service (Note: assumes Cygwin is installed at C:\Cygwin):
cygrunsrv --install gitd \
--path c:/cygwin/bin/bash.exe \
--args c:/cygwin/usr/bin/gitd \
--desc "Git Daemon" \
--neverexits \
--shutdown
Step 4: Run the following command to start the service:
cygrunsrv --start gitd
You are done. If you want a test it, here is a quick and dirty script that shows that you can push over the git protocol to your local machine:
#!/bin/bash
echo "Creating main git repo ..."
mkdir -p /git/testapp.git
cd /git/testapp.git
git init --bare
touch git-daemon-export-ok
echo "Creating local repo ..."
cd
mkdir testapp
cd testapp
git init
echo "Creating test file ..."
touch testfile
git add -A
git commit -m 'Test message'
echo "Pushing master to main repo ..."
git push git://localhost/testapp.git master