Git is not detecting a file and is not in .gitignore

前端 未结 16 1359
执念已碎
执念已碎 2020-12-05 04:19

I have a file called \"style.css\" and git is not detecting it. It doesn\'t detect it if I delete it either, but it does detect if I change the name of the file. But I need

相关标签:
16条回答
  • 2020-12-05 04:43

    some want to add an empty folder for some reasons If the content of the folder is empty, then there is no reason for git to mention it.

    A convention says that you might want to add a file .keep to it. which could also any other file.

    see here or here

    0 讨论(0)
  • 2020-12-05 04:44

    If your project is a maven project, check if you changed the src file or the target file. That's what I did recently. With the file path reference being too long, I failed to notice the 'target' in the path. All good after 1 hr of agony.

    0 讨论(0)
  • 2020-12-05 04:45

    Another reason to this problem may be the .gitignore_global file. In my case, it was automatically produced by Sourcetree app while i was ignoring file. It was in my user path(/Users/user_name/.gitignore_global).

    0 讨论(0)
  • 2020-12-05 04:45

    I encountered another cause for this. Probably very rare circumstances.

    I copied my entire repository to another folder to work on it. Changes I made to a submodule just weren't being detected by git. Turned out that the .git file in the submodule folder contained an absolute file reference to the original copy. As soon as I corrected the file reference to point to my working copy all was well.

    0 讨论(0)
提交回复
热议问题