douzun4443 2014-07-03 14:11
浏览 129
已采纳

Git子模块.gitignore仍然跟踪文件

My problem is very simple.

I have project, this project includes as a submodule another project. This submodule has a .gitignore as follows:

*~
~*
.DS_Store
nbproject
core.ini.php

Yet, every time I create a new core.ini.php file (for local specification purposes), the file gets included in the watched file list, committing it into the repository. So despite the .gitignore of both the project AS WELL as the submodule specifying to ignore that file, it still gets added.

Here is just a screenshot to show that it is indeed added:

.gitignore addition http://i58.tinypic.com/1zmpn3m.png

I would appreciate any advise or help. Thank you.

  • 写回答

2条回答 默认 最新

  • douchiwan1503 2014-07-03 14:22
    关注

    To expand on my comment on the OP, it looks like you probably added that file to the index at some point prior to adding it to the .gitignore file.

    It's fairly easy to get yourself into this tight spot where git won't track the delete of the file (because it's already in the .gitignore!) - so the easiest way to achieve what you need is to:

    1. Remove the specific file from the .gitignore file
    2. Delete the file
    3. Commit this deletion action
    4. Add the line back into the .gitignore
    5. Re-add your ignored file.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 C#中的编译平台的区别影响
  • ¥15 软件供应链安全是跟可靠性有关还是跟安全性有关?
  • ¥15 电脑蓝屏logfilessrtsrttrail问题
  • ¥20 关于wordpress建站遇到的问题!(语言-php)(相关搜索:云服务器)
  • ¥15 【求职】怎么找到一个周围人素质都很高不会欺负他人,并且未来月薪能够达到一万以上(技术岗)的工作?希望可以收到写有具体,可靠,已经实践过了的路径的回答?
  • ¥15 Java+vue部署版本反编译
  • ¥100 对反编译和ai熟悉的开发者。
  • ¥15 带序列特征的多输出预测模型
  • ¥15 Python 如何安装 distutils模块
  • ¥15 关于#网络#的问题:网络是从楼上引一根网线下来,接了2台傻瓜交换机,也更换了ip还是不行