Assuming that P4Merge was installed in the default location on Windows, i.e 'C:\Program Files\Perforce\p4merge.exe' then the following commands will configure p4merge as the default tool for both merge and diffs in Git
Set up commands
$ git config --global diff.tool p4merge
$ git config --global difftool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
$ git config --global merge.tool p4merge
$ git config --global mergetool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'
You can launch p4merge from the command line:
git difftool
git mergtool
You can check if the configuration was done correctly by issuing the following command:
git config --global -l