"unable to write new_index file" from git on SFTP share

0

To access a git repo on my Linux machine from another Windows PC, I use sftp drive. When making commits on Windows with the SFTP folder mounted as network share, it fails with the following error:

PS L:\home\user\repo> git commit -m "Added ansible conifg"
fatal: unable to write new_index file

Other posts indicates an permission error or low space. But the mount point has 160 GB free and I'm able to write in files using PowerShell without problems:

PS L:\home\user\repo> echo test > .git/testfile
PS L:\home\user\repo> dir .git | findstr testfile
-a----       14/01/2020     14:06             14 testfile

Why throws git those error and what's required to fix it?

Lion

Posted 2020-01-14T13:15:17.217

Reputation: 203

Sounds like the .git\index file may be locked. Check to see if another process has a handle on it using SysInternals Process Explorer. Instructions: Go to Find > Find Handle or DLL. In the "Handle or DLL substring:" text box, type the path to the file (e.g. "C:\path\to\file.txt") and click "Search". All processes which have an open handle to that file should be listed. (download: https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer )

– Narzard – 2020-01-14T19:47:38.460

No answers