I have two files new.txt and new2.txt. I want to find the differences between these two files and was thinking to use git diff for the same but I couldn't. This is what I have done till now and respective errors -
git diff
is meant to do much more than compare two specific files, but it does have a mode in which it will do so:
git diff --no-index new.txt new2.txt
will do the job. You do not need to be in a Git repository. All of these arguments (--no-index
and the two specific file names) are (sometimes) required (sometimes you can omit the --no-index
).