Recently I did try to use jenkins together with git on windows. During configuration i stumbled along some blogpost that advised to use git.cmd instead of git.exe (which does set some more enviromnent variables, for example %HOME% to use _nettrc of curl)
Unfortunately using git.cmd leads to many very strange errors in jenkins, like missing branches, or ambiguous checkouts. Testing with some random Java project from github gave the same results, but reverting back to git.exe (and setting %HOME% for the serveruser manually) did the trick .. everything works correctly as expected 🙂