1

I want to use it to diff two files which does not belong to any git project. Note that I want to use git diff as a difftool, not set git diff to any difftool.

2

1 Answer 1

4

As mentioned in the documentation, it should be possible when you pass --no-index

git diff [<options>] --no-index [--] <path> <path>
compare the given two paths on the filesystem. You can omit the --no-index option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running the command outside a working tree controlled by Git.This form is to

https://git-scm.com/docs/git-diff

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.