cannot add files to git commit

时间:2017-12-18 05:02:58

标签: git bash

I have tried several solutions in this forum, but I cannot add files to be committed. I use git add -A but my git bash just freezes. I have removed the index.lock file. It seems to be created every time I run git add -A , but nothing happens. It just sits there with a blinking cursor. I upgraded my git bash, re-initialized my project, but it is still the same issue. I have tried many solutions from the below thread and similar ones:

Another git process seems to be running in this repository

Full error:

Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.

I am using Windows 10 and use atom if that helps.

1 个答案:

答案 0 :(得分:1)

First, use Process Explorer to check if there is indeed another git process still running.

Second, check what your untracked files (that you are trying to add to the index) are:

git ls-files --others --exclude-standard

You might have way too many: adjust your .gitignore accordingly.

Once that is done, try again, from a CMD session (close Atom)


As mentioned by the OP in the comments, the issue comes from a folder named "Aux".
And, as explained in "Why can't we make CON, PRN, Null folder in Windows?", you cannot create or delete a folder named "Aux".

Ideally, you would delete it first:

DEL \\.\c:\path\to\Aux

Then you can try your git add -A again.