Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MarkerB opened this issue Oct 30, 2018 · 16 comments
Closed

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

MarkerB opened this issue Oct 30, 2018 · 16 comments

Comments

@MarkerB
Copy link

MarkerB commented Oct 30, 2018

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.

@iAmWillShepherd
Copy link
Contributor

iAmWillShepherd commented Oct 30, 2018

How much disk space do you have and how much of is currently being used? Also, can you confirm if you get the same error using the git CLI?

@iAmWillShepherd iAmWillShepherd added the more-info-needed The submitter needs to provide more information about the issue label Oct 30, 2018
@MarkerB
Copy link
Author

MarkerB commented Oct 30, 2018

188 GB free out of 238 GB.

Uh, oh. I'm using the GitHub Desktop because I don't know the CLI. That was kind of the whole point of a GUI product, I thought.

Okay. I will install the CLI and try to figure out how to commit.

Thanks for your quick response!

@steveward
Copy link
Member

@MarkerB a few other questions that may help us track down the cause of this:

  • Are you storing this repository in a regular user directory with the correct permissions set? Often these types of errors can be related to permissions issues, but if you are able to clone to the directory then that doesn't seen likely.

  • Is this repository being stored in a directory that is being tracked by a file sharing service like DropBox? That can sometimes cause these types of issues as well.

@MarkerB
Copy link
Author

MarkerB commented Oct 30, 2018

Ah, hah! I am using Google Backup and Sync! I thought it would be read-only, but who knows?

I'll disable it and try again.

Thank you so much for this!

@steveward
Copy link
Member

@MarkerB just wanted to follow up -- did that get things working for you?

@MarkerB
Copy link
Author

MarkerB commented Oct 31, 2018

Oh, yes. So far, so good. It was an intermittent problem, so I wanted to give it a little more of a test.

Google Backup and Sync may have been locking the git index file when it saw the file updated, locking it long enough to upload it to the cloud. Maybe GitHub Desktop needed the file more freely accessible than that.

Since Google Backup and Sync doesn't allow exclusion by folder, I had to put my git repo in a completely separate folder.

Thank you so much! This had been a real problem for me in the last week; not sure why it came and went. Timing.

@alphaKuz
Copy link

alphaKuz commented Oct 31, 2018 via email

@steveward
Copy link
Member

@MarkerB I'm glad to hear things are working now. Since we've identified that as the root cause I'm going to close this issue out.

@steveward steveward removed the more-info-needed The submitter needs to provide more information about the issue label Nov 1, 2018
@riwalenn
Copy link

riwalenn commented Apr 4, 2019

Thanks man, you right Google Backup and Sync suck :/

@MarkerB
Copy link
Author

MarkerB commented 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.

@riwalenn
Copy link

riwalenn commented Apr 4, 2019

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.

Yeah sorry, it's just that i have a very poor english and just to thank you for the solution. And i think it isn't normal that the problem already exist and they don't found a solution :/

@Abesuden
Copy link

Abesuden commented 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.

@viennaappdev
Copy link

image
Hello there.
I also get the same issue when push, after reinstall operating system.
Please give me solution.

@steveward
Copy link
Member

@wangdanyang711 are you storing your repositories in a file syncing service? Are there any other Git applications running? Can you verify that the correct file permissions are set for the location where you are storing your repositories?

@viennaappdev
Copy link

Thanks for your reply.
-are you storing your repositories in a file syncing service?
I don't know about the file syncing service. so I am not sure I am using it.
-Are there any other Git applications running?
yes. Git Bash application installed. for using git with command lines. but I am not so good at command lines for git.
so I don't use it.
image

-Can you verify that the correct file permissions are set for the location where you are storing your repositories?
you mean like as below image?
image
It seems readonly. so I unchecked readOnly option but also it does not work.

@steveward
Copy link
Member

The folder permissions would be visible in the Security tab. Are you able to commit changes using Git Bash?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants