question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"fatal: Could not write a new index file" on Windows 10

See original GitHub issue

Description

I get this error when attempting to commit. I can start from scratch with a new clone of an entire repo, but it eventually comes back again.

gitdesktopcommitfatal

It’s happened with various repositories, and on my previous Windows 7 Ultimate installation.

I’ve tried to delete the .git/index file, but then it shows that all the files in my repo are brand new. That’s not going to work.

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 the github.com repo down to my machine, and re-implementing all the changes I had made since my last successful commit and push.

I additionally find I often need to uninstall and reinstall GitHub Desktop to get it to commit without error.

Version

  • GitHub Desktop for Windows 1.4.3 64 bit
  • Operating system: Windows 10 Pro

Additional Information

Logs

2018-10-30T15:58:29.041Z - info: [ui] Background fetch for 3 repositories took 2.028sec 2018-10-30T16:02:09.254Z - info: [ui] Executing fetch: git -c credential.helper= fetch --progress --prune origin (took 3.395s) 2018-10-30T16:13:30.883Z - info: [ui] Background fetch for 3 repositories took 1.837sec 2018-10-30T16:18:07.639Z - info: [ui] [AppStore] loading 3 repositories from store 2018-10-30T16:18:07.641Z - info: [ui] [AppStore] found account: MarkerB (Mark Bernard) 2018-10-30T16:18:08.096Z - info: [ui] launching: 1.4.3 (Windows 10.0.16299) 2018-10-30T16:18:08.097Z - info: [ui] execPath: ‘C:\Users\mark\AppData\Local\GitHubDesktop\app-1.4.3\GitHubDesktop.exe’ 2018-10-30T16:18:09.081Z - info: [ui] Executing installGlobalLFSFilter: git lfs install --skip-repo (took 1.137s) 2018-10-30T16:18:16.401Z - error: [ui] git reset -- . exited with an unexpected code: 128. Unstaged changes after reset: M xxxxxxx_archive.php M functions/xxx/xxxmisc.php

fatal: Could not write new index file.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

25reactions
Abesudencommented, Mar 28, 2020

I had the same issue but my solution was to close my VS Code program (I had the GitHub Repo loaded in the side panel). I guess it ties up the GitHub Desktop and causes this type of issue.

1reaction
MarkerBcommented, Apr 4, 2019

Thanks man, you right Google Backup and Sync suck 😕

It’s probably not that simple. It seems more likely it’s just an unfortunate interaction between GitHub and Google and creative methods they use to keep track of things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git 'fatal: Unable to write new index file' - Stack Overflow
The error message fatal: Unable to write new index file means that we could not write the new content to the git index...
Read more >
fatal: Could not write new index file. · Issue #5012 - GitHub
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...
Read more >
git fatal: could not write new index file.
The index file has become corrupted, but it is easily re-creatable. Just remove it rm .git/index Then you can re-add the files you're...
Read more >
Git fatal: unable to write new_index file - Server Fault
I have found that SSHing to the server as the www-data user, cd'ing to the .git folder within the project, and then renaming...
Read more >
Git commit fails with "unable to write new index file"
fatal : Unable to write new index file”. I can commit the same changes to the same repo with Visual Studio 2017 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found