2

So it appears that I have the exact same problem as the individual who asked this question...

Github windows: Commit failed: Failed to create a new commit

I followed the steps suggested in the top voted answer yet it did not fix my problem. I then did what the third top ranked answer suggested...removing the index.lock file form the .git folder...yet this did not resolve the problem either as it seems that the index.lock file keeps getting regenerated when I try to commit again.

Anyone have any suggestions?

Thanks in advance!


Ok so I've come to a realization that some process has a lock on the .git\index file...after reading this indivual's post... Git rename from index.lock to index failed…... how would I find out what this process is?

I can then kill that process and continue


So guys this is the full steps I had to take in order to fix the problem...

1) Using Process Explorer (you can download it form here http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) I searched for any process referencing ".git\index" and then I killed it.

2)Then using Git Shell (Windows Power Shell) I went into the repository which was giving me such difficulty and then furthermore went into its .git folder. (cd .\your_respository_name.git). I then removed the index.lock file in that directory (rm -r index.lock).

3)Then from within that same directory I ran git reset HEAD.

4)Then I manually committed each file using the "git add [file_name]" comand. (You can check that they were added successfully if when you run git status, the files are green.

5)Next run git commit if your files are added correctly.

6)Finally go back to github for windows and sync everything up and it should hopefully work and resolve the problem.

Community
  • 1
  • 1
Sabashan Ragavan
  • 728
  • 1
  • 5
  • 14
  • Ok so I've come to a realization that some process has a lock on the .git\index file...after reading this indivual's post... http://stackoverflow.com/questions/13635429/git-rename-from-index-lock-to-index-failed... how would I find out what this process is? – Sabashan Ragavan Jun 09 '13 at 02:40
  • I can then kill that process and continue – Sabashan Ragavan Jun 09 '13 at 02:42
  • Please update your question with the additional information in your comment. – Toby Allen Jun 09 '13 at 18:47

4 Answers4

4

So guys this is the full steps I had to take in order to fix the problem...

1) Using Process Explorer (you can download it form here http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) I searched for any process referencing ".git\index" and then I killed it.

2)Then using Git Shell (Windows Power Shell) I went into the repository which was giving me such difficulty and then furthermore went into its .git folder. (cd .\your_respository_name\.git). I then removed the index.lock file in that directory (rm -r index.lock).

3)Then from within that same directory I ran git reset HEAD.

4)Then I manually committed each file using the "git add [file_name]" comand. (You can check that they were added successfully if when you run git status, the files are green.

5)Next run git commit if your files are added correctly.

6)Finally go back to github for windows and sync everything up and it should hopefully work and resolve the problem.

Sabashan Ragavan
  • 728
  • 1
  • 5
  • 14
  • Please add this as an answer to the origional question. Your question is not a question but your answer may be quite usefule – Toby Allen Jun 09 '13 at 18:47
  • Thank you for sharing this. I come back to this page every month or so and repeat this process... – Ben Y Oct 18 '13 at 15:47
2

If you have a process blocking (keeping an handle) on a git resource, you can track it using process explorer.

Search for any process referencing ".git\index" and you will be able to kill it.

enter image description here

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0
  1. Install winrar if you don't have it
  2. Go to your repository folder
  3. Open the .git folder
  4. Delete index.lock
  5. Did it work?
onurhb
  • 1,151
  • 2
  • 15
  • 31
0

Error Message: commit failed - exit code 1 received

Solution:

  1. Open your repository folder.
  2. Delete .git folder from your repository folder.
  3. Retry to commit and push.
barbsan
  • 3,418
  • 11
  • 21
  • 28
Mr.K
  • 13
  • 4