WinMerge 過濾器用法


WinMerge是一款開源的文件對比合並工具。
http://winmerge.org/
WinMerge提供了“過濾器”功能,可以在對比時排除特定的目錄或文件。

1、編輯過濾規則
工具 -> 過濾器 -> Exclude Source Control -> 編輯 -> SourceControl.flt -> 在最后輸入過濾規則

2、過濾規則簡單說明
f: <正則表達式> 表示過濾文件名,如果正則表達工要過濾“.”,則前面要加 \ 轉義
d: <正則表達式> 表示過濾目錄
## 表示注釋

3、過濾例子
(1)f: \.bak$
過濾所有.bak的文件名
(2)f: ^1.txt$
過濾文件名1.txt

4、規則測試
在修改過濾器的時候,有一個“測試”按鈕,這里輸入的內容,如果能夠顯示出來的話,則會顯示“passed”,如果不會顯示在列表中,則會顯示“failed”。

 

附,SourceControl.flt文件內容:

## This is a directory/file filter for WinMerge
## This filter lets through only files ASP.NET developers care about
name: Exclude Source Control
desc: Exclude Source Control files and directories

## This is an inclusive (loose) filter
## (it lets through everything not specified)
def: include


## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)

## f: \.bzrignore$ ## Bazaar ignore file
## f: \.cvsignore$ ## CVS ignore file
## f: \.gitignore$ ## Git ignore file
## f: \.hgignore$ ## Mercurial ignore file
## f: \.svnignore$ ## Subversion ignore file

f: \.(vs[sp])?scc$ ## Visual SourceSafe files

d: \\\.svn$ ## Subversion working copy
d: \\_svn$ ## Subversion working copy ASP.NET Hack
d: \\cvs$ ## CVS control directory
d: \\\.git$ ## Git directory
d: \\\.bzr$ ## Bazaar branch
d: \\\.hg$ ## Mercurial repository


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM