0

I'm having issue running git dff with +Dir01/file.m.

I think the problem is with the + in the directory name. How can I get git diff to work with this?

Thank you in advance.

Suever
  • 64,497
  • 14
  • 82
  • 101
kirikoumath
  • 723
  • 9
  • 20
  • What difficulties? What error? I'm having an issue understanding this question. – Adriaan May 11 '16 at 20:39
  • I get an error `errr while processing command line Not an editor command +Dir01/file.m ` – kirikoumath May 11 '16 at 21:21
  • @Adriaan I get the same error with vim. So I guess since i'm using vimdiff for my git difftool, the same error persists. My guess is that vim doesn't like + in the directory name? – kirikoumath May 11 '16 at 21:23

1 Answers1

2

Vim does not like opening files that have a leading + character. You can try prefacing your path with ./.

git diff ./+Dir01/file.m

Another way that you can open these types of files with vim is to use -- to indicate that no options should be passed, and then vim won't treat the + as a command.

vim -- +Dir01/file.m

Knowing this, you could use the -x argument for git difftool.

git difftool -x "vimdiff --"

You could update your .git/config with the following:

git config --global difftool.vimdiff.cmd "vimdiff -- \"\$LOCAL\" \"\$REMOTE\""
Suever
  • 64,497
  • 14
  • 82
  • 101