Dieses Blog durchsuchen

Montag, 10. Oktober 2016

git: add p4merge as diff and mergetool to console

On windows its useful to use a difftool like p4merge.exe to compare 2 versions of a file.

Lets configure git to use p4merge

Prerequisits

We need some things installed on the local machine.

Edit .gitconfig

open a terminal
git config --global merge.tool p4merge
git config --global mergetool.p4merge.path "<path/to/p4merge.exe>"
git config --global mergetool.prompt false
git config --global diff.tool p4merge
git config --global difftool.p4merge.path "<path/to/p4merge.exe>"
git config --global difftool.prompt false
 
This will make git use p4merge for diff and merging your files visualy

You can test this new difftool by comparing unstaged changes like that:
git difftool
 

Keine Kommentare:

Kommentar veröffentlichen