Search code examples
gitcygwin

Git commit on Windows (Cygwin) is broken.


I've got a Cygwin install on Windows 7. Git was working great up until a few days ago, when commits just stopped working. Here's a log of a brand new repo:

wt@CO /cygdrive/u/Projects
$ mkdir Temp

wt@CO /cygdrive/u/Projects
$ cd Temp/

wt@CO /cygdrive/u/Projects/Temp
$ touch Hello.txt

wt@CO /cygdrive/u/Projects/Temp
$ git init
Initialized empty Git repository in /cygdrive/u/Projects/Temp/.git/

wt@CO /cygdrive/u/Projects/Temp
$ git add .

wt@CO /cygdrive/u/Projects/Temp
$ git commit -m "hi"
error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for 'Hello
.txt'
error: Error building trees

I've Google-ed the hell out of it to no avail. What's going on here?


Solution

  • The question stated that the repo was working, but them mysteriously broke. The error seems to indicate a file system read issue with the internal git tree objects. Looking at /cygdrive/u, indicates that this is likely a mapped network drive.

    Try and run git on a local drive to confirm the network share is working correctly.

    Unfortunately, I don't have any exact information what would be causing the failure. It is possible that your network share does not support the file system features that git is expecting to be available.