Araxis Merge 基本配置及操作

 1.Araxis Merge簡介

$129 / TRY FREE FOR 30 DAYS

Advanced 2 and 3-way file comparison (diff), merging and folder synchronization for WindowsMac OS X.

Merge is the visual file comparison (diff), merging and folder synchronization application from Araxis. Use it to compare and merge source code, web pages, XML and other text files with native application performance. Directly open and compare the text from Microsoft Office(Word and Excel), Open DocumentPDF and RTF files. Compare images and binary files. Synchronize folders. Perform code reviews and audits. Work with folder hierarchies containing thousands of files.

 

2.Araxis Merge一覽

(1)Araxis Merge 2009 for Windows:

(2)Araxis Merge2012/2013 for Windows:(本文以Araxis Merge 2013 for Windows 7爲例)

 

(3)Araxis Merge 2013 for Mac OS X:

 

(4)Folder Comparisons:

 

(5)Text Comparisons:

 

3.新建比較

Araxis Merge支持文件夾(folder)、文本文件(text)、圖片(image)和二進制(binary)比較。

Ctrl+D:Next Folder Comparison(新建文件夾比較)

Ctrl+L:Next Text Comparison(新建文件計較)

 

Ctrl+F4:Close Comparison(關閉當前比較tab/窗口)

Alt+F4:Close Window(關閉應用程序/所有窗口)

 

4.展開/摺疊文件夾

Ctrl++/-:Expand/Collapse All Rows(展開/摺疊所有文件)

F5:Recompare(刷新/重新比較)

 

5.交換文件(夾)左右比較方向

 

6.視圖過濾

Ctrl+F:Hide Empty Folders(隱藏空文件夾)

Hide unchanged rows:隱藏無變動的文件

Show hidden items:顯示隱藏(過濾)掉的文件

Visibility Filters可以設置隱藏指定狀態的行(文件夾/文件)

 

7.選擇操作

Ctrl+S:Select Changed(選擇所有有改動的文件,方便批量操作)

Ctrl+T:Deselect All(取消所選)

Ctrl+I:Invert Selection(顛倒所選)

Ctrl+M:Launch File Comparisons for Selections(啓動所選比較)

Ctrl+R:Re-Test Selected(重新比較所選差異,區別F5全量刷新)

Ctrl+K:Mark Resolved(灰顯已解決)

Ctrl+W/Q:Copy Selected Items From: First To Second/SecondTo First

 

8.編輯變動點

Alt+Left/Right:Previous/NextChange in folder/text comparison

對比文件中有差異的地方可以手動編輯,也可以執行快速替換、插入和刪除操作:

 

9.設置編碼格式

我們看到上面文件比較中文亂碼,可以設置文本文件的編碼解決該問題。

確認對話框點擊“Cancel”取消保存,否則可能破壞原有代碼編碼格式。

 

關於編碼格式參考:《UTF-8 and UTF-8without BOM》《UTF8與UTF8without BOM之間的問題⎡帶 BOM 的 UTF-8⎦和⎡無 BOM 的 UTF-8⎦

 

10.設置tab距離和縮進

 

11.設置支持比較的文件類型

這裏可以添加pattern,以支持開發分支中某些特定格式文件。

BTW:在“Fonts and Colours”中可以設置各種狀態(Unchanged、Inserted、Removed、Changed)的背景色和字體。

 

12.設置不支持比較的文件類型過濾器

(1)勾選“Scan contents of excluded”後面的folders和files,使能過濾器。

(2)創建exclude過濾器,過濾掉以‘.’開頭的目錄或文件(例如“.svn”目錄)。

BTW:在“Fonts and Colours”中勾選"Customize folder comparison fonts and colours",可以設置各種狀態(Unchanged、Inserted、Removed、Changed)的背景色和字體。

 

13.設置Araxis Merge作爲TortoiseSVNWindows)的外部比較/合流工具

(1)選擇任一Revision,右鍵打開Settings。

(2)選擇External Programs-DiffViewer,設置爲External Diff Viewer

(3)選擇External Programs-Merge Tool,設置爲External Merge Tool

 

14.設置Araxis Merge作爲SyncroSVNMac OS X)的外部比較/合流工具

(1)參考Sample Scripts編寫Apple Script腳本AraxisMerge.scpt

在 AraxisMerge 2013 的安裝包(mount dmg)中包含 Sample Scripts:

參考 16 Compare Subversion repository paths.scpt 將其修改爲支持兩個參數的 AraxisMerge.scpt:

-- Sample Scripts\16 Compare Subversion repository paths.scpt
-- Performs a comparison between two tagged versions of the Adium source.

-- on svndiff {leftFile, rightFile}
on run ({leftFile, rightFile})
    
    -- Performs a comparison between two tagged versions of the Adium source.
    tell application "Araxis Merge"
        -- Start/connect to Merge without displaying any UI
        launch
        compare {leftFile, rightFile}
    end tell
    
end run
-- end svndiff

然後可以進一步封裝爲 AraxisMerge.sh:

osascript /Applications/AraxisMerge.scpt $1 $2

注意:由於run Handler只接受一個參數,故這裏採用了Handlers with Patterned Positional Parameters

(2)配置外部Diff Tool啓動腳本及參數。

注意:AraxisMerge.scpt(AraxisMerge.sh)權限默認爲 -rw-r--r--,需要執行 sudo chmod u+x /Applications/AraxisMerge.scpt 爲當前用戶添加可執行權限(-rwxr--r--)。若使用sh封裝osascript,不能將sh所有參數($@)傳遞給osacript,因爲sh運行的第一個參數($0)爲文件名,故應指定$1和$2。

  • 以下爲 macOS 下 SyncroSVN 配置 AraxisMerge 作爲其 Diff Tools:

  • 考慮到 git lfs,macOS 下 smartGit 默認只打開比較 1M 以下的文件,1M 以上的文件可以 force compare,也可以配置 AraxisMerge 作爲某些大文件(如 pbxproj 類型)的 External Diff Tools。以下複用了 Sourcetree 自帶的 sh 腳本(/Applications/Sourcetree.app/Contents/Resources/araxiscompare-w.sh):

15.設置Araxis Merge作爲Subversion命令行(Mac/Linux)的外部比較工具

參考《ARAXIS MERGE for OS X Command-Line Reference》。

參考:

Araxis Merge和Beyond Compare功能對比

Diff Tools on Mac OS X》 

Araxis Merge alternatives:Xcode FileMerge,Kdiff3Kaleidoscope

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章