LoginSignup
39

More than 5 years have passed since last update.

git mergetoolでマージする

Posted at

Conflictの解消とかわかりにくいから、そこはGUIでMergeしたいという方へ。

ScreenShot of DiffMerge

自分の知っている中で一番優秀なFreeのmargetoolはdiffmerge(http://www.sourcegear.com/diffmerge/)

3-way-mergeに対応していて、左右で自分と相手の変更を見ながら、真ん中のViewでEditできる!さらに、真ん中のViewでは初期状態としてMerge元の状態が表示されているので、それも確認しながら最終バージョンを作成できる!!
とりあえずダウンロードしよう!(注:ダウンロード時のEmailアドレス登録はスキップできる。)

Merge(git mergetool)用の設定

git config --global merge.tool diffmerge
git config --global mergetool.keepBackup false
git config --global mergetool.diffmerge.cmd "diffmerge --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE"
git config --global mergetool.diffmerge.trustExitCode true

Diff(git difftool)用の設定

git config --global diff.tool diffmerge
git config --global difftool.diffmerge.cmd "diffmerge \$LOCAL \$REMOTE"

参考:

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
39