我在components/root/js/
和components/example/js/
有目录,我不希望这些被Git跟踪。.gitignore在特定深度的目录?
但是,我有一个目录components/root/js2/plugins/js/
,我想跟踪Git。
我抬头看了这个在线,只发现**
,我相信这并不能解决我的问题。
我现在.gitconfig
包含行:
js/
我试图将此更改为:
components/**/js/
但这对于components/root/js/
匹配,components/example/js/
,也components/root/js2/plugins/js/
(下面的一个文件夹js
第二级components
- 我只想在第二级忽略js
文件夹)。
我该如何实现这个目标?
你真的指'components/root/js2/plugins/js'而不是'components/root/js/plugins/js'吗? –
@ArkadiuszDrabczyk是的 - 基本上,我不想同步'components/root/js',但我想同步'components/root/js2',我也想同步'components/root/js2/plugins/js',如果这是有道理的。我也希望这样可以申请任何其他目录名称,例如'components/abcd/js2/plugins/js'。 – think123
嗯,我不知道我跟着 - 如果你添加了'components/root/js /'和'components/example/js /'到你的'.gitignore',那么停止'git'跟踪'components/root/JS2 /'?它不是被忽略的目录的子目录。 –