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
error: Error building trees

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

  • git feature branch: rebase -i or merge --no-ff?
  • How can I stage specific lines of file to git in NetBeans?
  • Don't checkin modified file in repo
  • Can I have GIT create a file with the current revision number on a commit?
  • Best git workflow for a team of developers and designers
  • git status - is there a way to show changes only in a specific directory?
  • GIT PUSH - Is there any way to know which developer actually pushed a code?
  • create tree without using staging area
  • 4 Solutions collect form web for “Git commit on Windows (Cygwin) is broken.”

    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.

    Cygwin git appears to be creating new object files using a “create-temp-file-then-hardlink-to-destination” method. I think the hard-linking is confusing for cygwin!

    Bottom line: solved using:

    git config --add "core.createobject" rename

    (My setup is Cygwin git, working on a .git directory over samba)

    Use Git for Windows instead. Cygwin’s Git started going downhill a while back. My team and I had more and more problems with it as time went on and finally just switched. With a full port of Git to Windows (the msysgit/Git for Windows project) available, why put up with the annoyances and outright brokenness that comes with Cygwin Git? We haven’t had a single issue since switching.

    The problem here is that Git’s default method of creating object files just plain doesn’t work on Windows shared drives, and (unlike Git for Windows or msysgit), Cygwin’s Git has just been using that default.

    Until today – I’m the Git maintainer for Cygwin – and I’ve just rebuilt it to use a different method that does work on shared drives (it has other disadvantages, but there’s not a lot we can do about that). If you run Cygwin’s setup-x86[_64].exe again and download the latest version of Git (v2.4.5-3 or later), you should find everything works again.

    (The new Git build has only just been uploaded, so it may take a little while to reach all the mirrors, but I think that’s at most 24 hours, and many mirrors are quicker than that.)

    Git Baby is a git and github fan, let's start git clone.