Despite having circumvented the problems caused by the new Windows Vista UAC – as described in an older blog entry of mine and found all around the internet, git sometimes still has problems.
At work, my team collaborates with SVN and commits to our company svn server. I am using git as an SVN client, because it is more convenient for me; with no problems on my Gentoo (dev) box, but I never managed to check out on my Windows laptop.
Sooner or later, the checkout would fail with an error message like this:
2 [main] git 3624 C:\cygwin\bin\git.exe: *** fatal error - could not load shell32, Win32 error 487 Hangup
I have had searched for advice on how to fix this and have found the – amongst cygwin developers quite known – /sbin/rebaseall command. This, however, does not work in this case. Upon my last inquiry on that subject, I stumbled about a recent post on the cygwin mailinglist, the problem was found related to checking out symlinks from an svn repository. This information is very important: the repository I am trying to check out makes heavy use of symlinks.
I checked the man pages for git and found there are some settings related to symlinks in general, and cygwin in special:
- core.symlinks
With this setting configured to false, symlinks will not be checked out as actual symlink, but as regular files with special content managed by git, then - core.ignoreCygwinFSTricks
With this setting configured to false, filesystem calls will use the cygwin calls, which are slower, but more more reliable in the context of a cygwin program.
You can read the detailled description here. With these settings done, git should be more reliable. Another setting I have found to be useful is the following:
- core.filemode
With this set to false, changes to file permissions will not be recorded by git and will not lead to diffs found in files. This has once rescued a checkout of mine which had been corrupted over the time.
Concluding, this is an excerpt from my Windows box’ ~/.gitconfig with the relevant settings:
[core] fileMode = false ignoreCygwinFSTricks = false symlinks = false
Hopefully, all problems are gone now