我該如何忽略一個目錄及其子目錄中的某個文件類型?如何在Git中忽略特定目錄及其子目錄中的某個文件類型?
爲了解釋我的意思成像以下設置
- anotherdir/
- seeme1.iml
- foldertoignore/
- ignoreme1.iml
- SE eme3.txt
- anotherignorefolder/
- ignoreme2.iml
- seeme4.txt
- seeme5.iml
我希望能夠做的是告訴git(使用.gitignore文件)忽略* .iml,但僅在目錄foldtertoignore。
我想這會工作
foldertoignore/*.iml
但是隻發現ignoreme1.iml不ignoreme2.iml
我知道如何告訴它忽略*除了一個.iml特定的目錄。這是相反的。有什麼想法嗎?
利用Windows msysgit, '''**' 似乎並沒有被遞歸應用(如http://stackoverflow.com/questions/971465/git-ignore-certain-files-已經看到contains-in-specific-folders/971523#971523,http://stackoverflow.com/questions/991801/git-ignores-and-maven-targets/991873#991873,並在這裏詳細解釋:http:// stackoverflow。 com/questions/2899875/git-add-not-working-with-png-files/2902126#2902126) – VonC
@Vonc - 我不是說這可能行不通?我不認爲OP提到了msysgit? – manojlds
是的,不,你沒有;)我的評論絕不是批評,只是一個事實,我已經在Windows上觀察msysgit,以及我的方式來將您的答案與其他類似的問題(有關'fnname')進行了討論。順便說一句,我並沒有降低你的答案(但我已經提高了knittl的,我發現這種情況更適合和強大)。 – VonC