I had a similar problem using Cruise Control, but for me I ran a batch file to execute all my git statements that were disabled, but only when starting from Cruise Control. Logging in as a user and executing a batch file manually without problems. In my batch file, a script was being built that included steps to run some git bash shell scripts to execute my git commands.
For example, my build process would fulfill this statement:
"c:\program files\git\git.exe" --login -i "myshellscript.sh"
Then, the shell script will execute some logic to clear the directories, check the specified branch or hash key, click notes, etc. This will freeze after the first fetch, and this is because the $ HOME directory in git bash was different between when CC starts as a service and from the moment I test using Remote Desktop. To confirm, I added an expression to "myshellscript.sh"
echo $HOME
This returned a different path than when I logged in as a desktop user, so it did not detect my ssh key files, which caused any git fetch to hang waiting for a user response. I found this guide to configure portable git, and it includes steps for automatically specifying your own home profile. To do this, find where git was installed, and edit the etc \ profile file. Change the lines:
# normalize HOME to unix path HOME="$(cd "$HOME" ; pwd)"
To:
# normalize HOME to unix path HOME="/c/Build Server/MyProfile" HOME="$(cd "$HOME" ; pwd)"
source share