# Download the lastest p4merge tool
wget http://cdist2.perforce.com/perforce/r14.1/bin.linux26x86_64/p4v.tgz
# Extract it into the local bin directory
sudo tar -zxvf p4v.tgz --strip 1 -C /usr/local
# Set your git to recognize the tool
git config --global merge.tool p4merge
# Install the lastest version of X11 Server
# http://xquartz.macosforge.org/trac/wiki/Releases
# or by using MacPort...
sudo port -v install xorg-server

Set the X11 Preferences as below

# By the X11 xterm, disable the Access Control
xhost +server_name
# Append the DISPLAY on the Remote Server
echo "export DISPLAY=desktop_name:0.0" >> ~/.bashrc