Compare only specified files

git diff-files

  • Compare files using their sha1 hashes and modes.
    More information: <https://git-scm.com/docs/git-diff-files>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

git diff-files {{path/to/file}}

click the source code to copy install git diff-files on any operating system with command-not-found.com