Last active
January 29, 2026 09:47
-
-
Save crmaxx/e8674c6228f4409f3bc6dd7337f95774 to your computer and use it in GitHub Desktop.
Installing and configuring P4Merge for Git on Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based on http://blogs.pdmlab.com/alexander.zeitler/articles/installing-and-configuring-p4merge-for-git-on-ubuntu/ | |
| $ cd ~/Downloads | |
| $ wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz | |
| $ tar zxvf p4v.tgz | |
| $ sudo mkdir /opt/p4v | |
| $ cd p4v-2018.2.1666551 | |
| $ sudo mv * /opt/p4v | |
| $ sudo ln -s /opt/p4v/bin/p4merge /usr/local/bin/p4merge | |
| ~/.gitconfig | |
| [color] | |
| ui = true | |
| diff = true | |
| branch = auto | |
| status = auto | |
| [alias] | |
| new = checkout -b | |
| co = checkout | |
| ci = commit | |
| cm = commit -m | |
| cam = commit -am | |
| ca = commit --amend # careful | |
| st = status | |
| br = branch | |
| lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen--> %cr%Creset by %Cblue%cN <%cE>%Creset' --abbre | |
| v-commit --date=relative | |
| hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
| type = cat-file -t | |
| dump = cat-file -p | |
| s = status --short | |
| a = !git add . && git status | |
| au = !git add -u . && git statustus | |
| aa = !git add . && git add -u . && git status | |
| ac = !git add . && git commit | |
| acm = !git add . && git commit -m | |
| put = push origin HEAD | |
| get = pull origin HEAD | |
| [merge] | |
| keepBackup = false; | |
| tool = p4merge | |
| [mergetool] | |
| prompt = false | |
| [mergetool "p4merge"] | |
| cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" | |
| keepTemporaries = false | |
| trustExitCode = false | |
| keepBackup = false | |
| [diff] | |
| tool = p4merge | |
| [difftool] | |
| prompt = false | |
| [difftool "p4merge"] | |
| cmd = p4merge "$LOCAL" "$REMOTE" | |
| keepTemporaries = false | |
| trustExitCode = false | |
| keepBackup = false |
Author
$ cd p4v-2018.2.1666551
doesnt work
ver is different
of course, this log was made in 2018 :)
Thanks 😃
thx!
Thanks for share it, help me a lot.
Thank you! Works like a charm.
However, if anyone got the following error after executing above procedure and trying to run p4merge:
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb, minimal, offscreen, vkkhrdisplay, vnc.
Aborted (core dumped)
Here is how to fix it.
Just install the following (assuming you are using apt for packages management, but if not, use your distro-specific tool):
sudo apt update
sudo apt install \
libxcb-cursor0 \
libxcb-xinerama0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxcb-xkb1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ cd p4v-2018.2.1666551
doesnt work
ver is different