You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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'
-->
I have a similar problem. Attempting to commit changes in github desktop I get "fatal: Could not write new index file." This is on a repository that I have been using for several years. The log shows:
2018-07-26T09:55:53.158Z - info: [ui] Executing push: git -c credential.helper= push origin v2-dev:v2-dev --progress (took 3.978s)
2018-07-26T09:55:56.921Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: RepRapFirmware - dc42 (has token)
2018-07-26T09:56:01.952Z - error: [ui] git reset -- . exited with an unexpected code: 128.
Unstaged changes after reset:
M src/Platform.cpp
M src/Version.h
fatal: Could not write new index file.
I can't see any index.lock file in the repository. Using Github Desktop 1.2.6.
What might have triggered this was an attempt to do a merge a different repository which resulted in "Unable to merge unrelated histories". But that was a different repository, and I have reloaded Github Desktop since then.
So I tried running the "git reset -- ." command from the command prompt (I had to install Git for Windows first, because the command prompt stopped working after a recent Github desktop update). That gave the message:
Rename from 'C:/Users/David/Documents/GitHub/RepRapFirmware/.git/index.lock' to 'C:/Users/David/Documents/GitHub/RepRapFirmware/.git/index' failed. Should I try again? (y/n)
Armed with that info, and finding files "index", "index.lock" and "index (1)" in the repository, I renamed file "index" to "index_old" and asked it to try again. This time it worked, and after that I was able to commit.
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.
Activity
steveward commentedon Jun 25, 2018
Closing this out since @johngrabner mentioned via email he resolved this by deleting the index.lock file in the repository.
dc42 commentedon Jul 26, 2018
I have a similar problem. Attempting to commit changes in github desktop I get "fatal: Could not write new index file." This is on a repository that I have been using for several years. The log shows:
2018-07-26T09:55:53.158Z - info: [ui] Executing push: git -c credential.helper= push origin v2-dev:v2-dev --progress (took 3.978s)
2018-07-26T09:55:56.921Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: RepRapFirmware - dc42 (has token)
2018-07-26T09:56:01.952Z - error: [ui]
git reset -- .exited with an unexpected code: 128.Unstaged changes after reset:
M src/Platform.cpp
M src/Version.h
fatal: Could not write new index file.
I can't see any index.lock file in the repository. Using Github Desktop 1.2.6.
What might have triggered this was an attempt to do a merge a different repository which resulted in "Unable to merge unrelated histories". But that was a different repository, and I have reloaded Github Desktop since then.
dc42 commentedon Jul 26, 2018
So I tried running the "git reset -- ." command from the command prompt (I had to install Git for Windows first, because the command prompt stopped working after a recent Github desktop update). That gave the message:
Rename from 'C:/Users/David/Documents/GitHub/RepRapFirmware/.git/index.lock' to 'C:/Users/David/Documents/GitHub/RepRapFirmware/.git/index' failed. Should I try again? (y/n)
Armed with that info, and finding files "index", "index.lock" and "index (1)" in the repository, I renamed file "index" to "index_old" and asked it to try again. This time it worked, and after that I was able to commit.
MarkerB commentedon Oct 30, 2018
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
herve76 commentedon Dec 10, 2020
same issue here, how come github desktop works so much better with mac os?
steveward commentedon Dec 10, 2020
@jsappme please open a new issue and fill out the template and we'd be happy to assist you.