Skip to content

fatal: Could not write new index file. #5012

Closed

Description

@johngrabner

Description

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

Activity

  1. steveward commented on Jun 25, 2018

    @steveward
    Contributor

    Closing this out since @johngrabner mentioned via email he resolved this by deleting the index.lock file in the repository.

  2. dc42 commented on Jul 26, 2018

    @dc42

    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.

  3. dc42 commented on Jul 26, 2018

    @dc42

    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.

  4. locked as resolved and limited conversation to collaborators on Sep 24, 2018
  5. unlocked this conversation on Sep 27, 2018
  6. MarkerB commented on Oct 30, 2018

    @MarkerB

    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

  7. herve76 commented on Dec 10, 2020

    @herve76

    same issue here, how come github desktop works so much better with mac os?

  8. steveward commented on Dec 10, 2020

    @steveward
    Contributor

    @jsappme please open a new issue and fill out the template and we'd be happy to assist you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions