Git + BeyondCompare

Mac 環境:javascript

1. 安裝 BeyondComparejava

2. 配置 ~/.gitconfiggit

[diff]
    tool = bcomp
[merge]
    tool = bcomp
[difftool "bcomp"]
    cmd = /usr/local/bin/bcomp $LOCAL $REMOTE
    trustExitCode = true
[mergetool "bcomp"]
    cmd = /usr/local/bin/bcomp $LOCAL $REMOTE $BASE $MERGED
    trustExitCode = true

3. 加個軟鏈app

$ ln -s /Applications/Beyond\ Compare.app/Contents/MacOS/bcomp /usr/local/bin/

4. 使用(若是 merge 時有衝突)blog

$ git merge develop
$ git mergetool

5. SourceTree 配置 BeyondCompareip

SourceTree -> Preferences -> Diff -> External Diff/Mergeci

參數:get

Visual Diff Tool: Customcmd

Diff Command: /usr/local/bin/bcompit

Arguments: $LOCAL $REMOTE

Merge Tool: Custom

Diff Command: /usr/local/bin/bcomp

Arguments: $LOCAL $REMOTE $BASE $MERGED

6. 個人 .gitconfig 配置文件:

[user]
	name = xxx
	email = xxx@xx.cn
[core]
	excludesfile = /Users/yamei/.gitignore_global
[diff]
	tool = bcomp
[merge]
	tool = bcomp
[alias]
	st = status -s
	ci = commit
	l = log --oneline --decorate -13
	ll = log --oneline --decorate
	co = checkout
	br = branch
	rb = rebase
	dci = dcommit
[difftool "bcomp"]
	cmd = /usr/local/bin/bcomp $LOCAL $REMOTE
    trustExitCode = true
[mergetool "bcomp"]
	cmd = /usr/local/bin/bcomp $LOCAL $REMOTE $BASE $MERGED
    trustExitCode = true
[difftool "sourcetree"]
	cmd = /usr/local/bin/bcomp $LOCAL $REMOTE
	path = 
[mergetool "sourcetree"]
	cmd = /usr/local/bin/bcomp $LOCAL $REMOTE $BASE $MERGED
	trustExitCode = true
相關文章
相關標籤/搜索