p4merge displays error 'nul is (or points to) an invalid file' when I am using git difftool --cached

1.4k Views Asked by At

I just decided and installed p4merge as my visual merge tool for git. In order to do that I've configured my git using this command

git config --global merge.tool p4merge
git config --global mergetool.p4merge.cmd 'p4merge $BASE $LOCAL $REMOTE $MERGED'

And then I tested them and ran git difftool command and it worked just fine. but when I ran git difftool --cached, p4merge displayed an error message:

nul is (or points to) an invalid file

I also tried to follow the instructions in this blog, but I couldn't resolve the problem.

By the way I use git & p4merge on windows 7. Does anyone know the solution to this problem?

1

There are 1 best solutions below

0
On

It is hard to say based on the given information, but I had the same issue due to whitespaces in the file under comparison. I use Linux instead, and I fixed it thanks to this post:

Just search for: bar "$@"