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条)

报告相同问题?

悬赏问题

  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1