3

I'm using cygwin under Windows to do some command line stuff. One of the commands I use sometimes is git stash. Since few weeks I always get this error when I use it: Cannot save the current index state

I also tried it in other projects, so it is no project related issue. The history is not broken or something like that. I don't use it often so I don't know when the issue started.

The error is thrown on line 110 of the git-stash file. That's why I debugged the two lines before.

$(printf 'index on %s\n' "$msg" | 
git commit-tree $i_tree -p $b_commit)

When I echo the first command it outputs my last commit. This seems ok. When I output both commands piped it is empty, so maybe something is wrong with "git commit-tree $i_tree -p $b_commit". I google a long time but was not able to find a solution to this issue.

Cygwin Git version: 2.14.1

Cygwin x64 version: 2.8.2(0.313/5/3)

Ben
  • 696
  • 9
  • 19

1 Answers1

2

First, check if the issue persists with bash (the bash packaged with Git). Make sure to set your PATH in order to:

  • no include cygwin
  • include git/bin, git/usr/bin, git/mingw64/bin: see this example.
    Working with a simplified path (for testing purposes) is important to make sure there is no side-effect from any other software.

Second, try and add a git status in the git stash critical lines, to see if the Git repo status reveal anything suspicious.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I removed the cygwin git package and installed git on windows. Was much more easier than debugging cygwins git bugs everytime. Was not the first bug, there were several before which dissapeared after few updates. But I don't want to wait for ever to get this issue fixed. – Ben Sep 20 '17 at 15:59
  • sorry, but your answer was neither the solution or help. There is still no fix for that cygwin git issue. Installing git on windows itself is just a quickfix and does not solve the root problem. – Ben Sep 21 '17 at 16:56
  • @ChampS Do you need cygwin? Or maybe WSL on Win10 would be an adequate environment? (https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) – VonC Sep 21 '17 at 18:54
  • 1
    git status did the work. I got a hint in a console what should I do next – Pavlo Zvarych May 25 '18 at 11:29