我有一个用于下载我的库依赖项的Python脚本(该库已提取为git存储库),它会为git存储库添加.git/info/exclude
行。但是,当它作为子模块提取时,不存在.git/info/exclude文件,我仍然需要排除一些路径而不将它们添加到'.gitignore'中。是否有任何更改可以实现这一点?
repo
├─.git
│ └─info
│ └─exclude
└─mylibrary (as_submodule)
├─extract_deps.py
└─some_dep (created by `extract_deps.py` and should be excluded)
在上面的图片中,我需要从git更改中排除
some_dep
。将
mylibrary/some_dep
添加到repo/.git/info/exclude
中并没有帮助,因为git status
仍然显示mylibrary/some_dep
已添加且未跟踪。
.gitsubmodules
中添加ignore = dirty
来解决子模块的问题。还有更好的解决方案吗? - 4ntoine