Git diff between two different files

diff()git

In HEAD (the latest commit), I have a file named foo. In my current working tree, I renamed it to bar, and also edited it.

I want to git diff foo in HEAD, and bar in my current working tree.

Best Answer

Specify the paths explicitly:

git diff HEAD:full/path/to/foo full/path/to/bar

Check out the --find-renames option in the git-diff docs.

Credit: twaggs.