douzun4443 2014-07-03 06: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 06: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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部