Git untracked files list is wrong

前端 未结 8 2013
南方客
南方客 2020-12-29 02:59

Somehow, git got it in its head that I have an untracked file (A directory that has been in my repository for quite some time, ~17 months). At any rate, I can\'t seem to con

8条回答
  •  再見小時候
    2020-12-29 03:41

    This error popped up for me when git add failed due to a file name being too long in a sub directory. (in my case, something in node_modules)

    In this case, adding a .gitignore file with content of * to the node_modules folder allowed git add to run to completion.

    So, pay attention to the command output of git add . (or -A or --all) and make sure it is not stopping prematurely due to an error. All of my "untracked" files and folders were added successfully once the proper .gitignore was applied and I was able to commit and push my changes.

提交回复
热议问题