我使用Git的項目,要排除從路徑特定的子文件夾而不是該文件夾的兄弟姐妹例如:你如何在gitignore文件中做負向Lookahead/Lookbehind?
/Testpath/TestpathA
/Testpath/TestpathB
/Testpath/TestpathC
我想忽略TestpathA和C(以及任何其他路徑可能是這些文件夾的兄弟姐妹,但不TestpathB
我試圖
/Testpath/*
!/Testpath/TestpathB
,但沒有奏效。
我一個LSO試圖 /Testpath /(?!TestpathB)/ *
但也不能工作。
我改變了你的標籤 - gitignores不使用正則表達式;他們使用特定的globbing風味。 – Cascabel 2011-01-27 06:05:14