我想忽略具有特定擴展名(例如* .config)的所有文件,因爲它們是生成的,除了名爲「packages.config」的靜態文件外。實質上,開發人員不應該在app.config,bob.config,web.config或任何其他擴展名爲「.config」的文件中不小心簽入。除了svn中的packages.config,忽略* .config的適當模式是什麼?
什麼是svn:ignore的合適模式?
我試過
如果我設置svn:無視
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
*.config
那麼所有的文件將被忽略,包括packages.config。這是預料之中的。因此,我想驗證我可以排除文件名中包含所有配置文件。
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
packages.config
哪個技巧。
但是,我無法得到該模式的反例。我搜索了互聯網的例子,並發現使用"^"和另一個使用"!"提及。
我試圖
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
!packages.config
這並沒有收到預期的效果。在這一點上,我意識到我顯然不明白如何實現這一點。所以我嘗試加入!packages.config
然後*.config
。
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
!packages.config
*.config
和*.config
然後!packages.config
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
*.config
!packages.config
並添加^packages.config
*.exe
*.dll
[Bb]in
[Oo]bj
[Rr]elease
[Dd]ebug
^packages.config
,沒有工作。
來源
很多,我訪問的重點是如何排除文件的網站。
- Ignoring Unversioned Items
- How do you include/exclude a certain type of files under Subversion?
- Re: inverse of svn:ignore property
- Shell Command Language(鏈接到這個頁面,瞭解模式匹配烏龜SVN)
- Using svn:ignore to ignore everything but certain files