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 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式