fatal: Could not write new index file.
See original GitHub issueDescription
Attempt to commit and get error msg “fatal: Could not write new index file.”
log file showed
2018-06-22T20:28:20.171Z - info: [ui] [AppStore] loading 1 repositories from store
2018-06-22T20:28:20.171Z - info: [ui] [AppStore] found account: johngrabner (johngrabner)
2018-06-22T20:28:20.520Z - info: [ui] launching: 1.2.3 (Windows 10.0.16299)
2018-06-22T20:28:20.520Z - info: [ui] execPath: ‘C:\Users\john_\AppData\Local\GitHubDesktop\app-1.2.3\GitHubDesktop.exe’
2018-06-22T20:28:39.680Z - error: [ui] git reset -- . exited with an unexpected code: 128.
Unstaged changes after reset:
M Coaster SW/Coaster_LED/Coaster_Application_Messages.c
M Coaster SW/Coaster_LED/message_and_state_definitions.c
M Coaster SW/Coaster_LED/message_and_state_definitions.h
M Coaster SW/Coaster_LED/nbproject/Makefile-genesis.properties
M Coaster SW/Coaster_LED/nbproject/private/private.xml
fatal: Could not write new index file.
Version
1.2.3 Place the version of your operating system below this comment. The operating system you are running on may also help with reproducing the issue. If you are on macOS, launch ‘About This Mac’ and write down the OS version listed. If you are on Windows, open ‘Command Prompt’ and attach the output of this command: ‘cmd /c ver’ –>
- Operating system: windows 10
Steps to Reproduce
click commit on project https://github.com/johngrabner/Coaster
Expected Behavior
Actual Behavior
Additional Information
Logs
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)

Top Related StackOverflow Question
I get this error continually in GitHub Desktop for Windows 1.4.3 x64 under Windows 10 Pro. If I delete the .git/index file, then run the program again, it shows that all the files in my repo are new. That’s not good.
If I restore an older version of the .git/index file, I still get the same error on committing. My workaround each time has been to start over from scratch, cloning my github.com repo down to my machine, and re-implementing all the changes I had made since my last commit and push. I often need to uninstall and reinstall GitHub Desktop to get it to commit without error.
I hadn’t noticed this thread was closed, so I opened a new issue at https://github.com/desktop/desktop/issues/6036
Closing this out since @johngrabner mentioned via email he resolved this by deleting the index.lock file in the repository.