2

I got the following message when trying to commit my app to Git:

**The working copy "XYZ" failed to commit files.**
fatal: Repository has been updated, but unable to write
new_index file. Check that disk is not full or quota is
not exceeded, and then "git reset HEAD" to recover.

I have been trying to understand how to recover from this and perform a "git reset HEAD" without discard anything committed. I have read about terminal commands and tried but still do not understand the steps to take.

The disk is not full, however it is located on my Qnap NAS on my network.

Could someone give me a step-by-step guide or point me to one?

PeterK
  • 4,243
  • 4
  • 44
  • 74

2 Answers2

1

git reset HEAD will not alter your working tree or commit history, it will only alter the index. So you don't have to worry about losing work in the sense of losing actual files in your working tree. You just have to make sure, that when you are ready to try the commit again, you add everything to the index that is supposed to be there, e.g. with git commit -a or explicitly with git add (however you staged your next commit last time, you can do it that way again.)

gcbenison
  • 11,723
  • 4
  • 44
  • 82
0

I would use git stashing. First stash the work that you cannot commit, reset to recover and then unstash back your work and recommit.

git stash
git reset HEAD
git stash show -p | git apply -R
git commit -am "new commit"
Maher Manoubi
  • 585
  • 1
  • 6
  • 18
  • Thanks Maher, should i do this in the same directory as my app? – PeterK Mar 06 '13 at 21:29
  • Maher, i get -bash: git: command not found in the directory were the app resides and in /Applications/Xcode.app/Contents/Developer/usr/bin – PeterK Mar 06 '13 at 21:42
  • Do you usually commit using the command line? If yes, then apply the commands from that location. – Maher Manoubi Mar 06 '13 at 21:46
  • Oh I see! If you type just git in your terminal, what do you get? If you get command not found. Try installing git in your mac: http://git-scm.com/ – Maher Manoubi Mar 06 '13 at 21:52