git設置mergetool可視化工具


 
可以設置BeyondCompare,DiffMerge等作為git的比較和合並的可視化工具,方便操作.

設置如下:

  1. 先下載並安裝BeyondCompare,DiffMerge等.
  2. 設置git配置,設置BeyondCompare的git命令如下:
    1.  
      #difftool 配置
    2.  
      git config -- global diff.tool bc4
    3.  
      git config -- global difftool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\""
    4.  
       
    5.  
       
    6.  
      #mergeftool 配置
    7.  
      git config -- global merge.tool bc4
    8.  
      git config -- global mergetool.bc4.cmd "\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""
    9.  
      git config -- global mergetool.bc4.trustExitCode true
    10.  
       
    11.  
      #讓git mergetool不再生成備份文件(*.orig)
    12.  
      git config -- global mergetool.keepBackup false

使用方法如下:

diff使用方法:

git difftool HEAD // 比較當前修改情況

merge使用方法

git mergetool

 

 

sourceTree設置方法如下:

1.在菜單(工具->選項)中設置如圖

 

2.使用菜單(操作->解決沖突->打開外部合並工具),則可使用


免責聲明!

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



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