cd ~/Downloads
wget https://cdist2.perforce.com/perforce/r19.1/bin.linux26x86_64/p4v.tgz
tar zxvf p4v.tgz
sudo mkdir /opt/p4v
cd p4v-2019.1.1865170
sudo mv * /opt/p4v
sudo ln -s /opt/p4v/bin/p4merge /usr/local/bin/p4merge
sudo nano ~/.gitconfig
Add the following if you only want to use p4merge as a diff tool
[diff]
tool = p4merge
[difftool]
prompt = false
[difftool "p4merge"]
cmd = p4merge "$LOCAL" "$REMOTE"
keepTemporaries = false
trustExitCode = false
keepBackup = false
Add the following if you also want to use p4merge as a merge tool
[merge]
keepBackup = false;
tool = p4merge
[mergetool]
prompt = false
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
Enjoy
git difftool branchOne/pathToFile/file.ts branchTwo/pathToFile/file.ts