git-diff-files
Show changes between the index and filesystem
TLDR
Compare all changed files
Compare only specified files
Show only the names of changed files
Output a summary of extended header information
SYNOPSIS
git diff-files [--quiet] [--ignore-space-change] [--ignore-all-space] [--ignore-blank-lines] [--find-renames=
PARAMETERS
--quiet
Do not output anything, just set the exit status based on whether changes were found.
--ignore-space-change
Ignore changes in amount of whitespace.
--ignore-all-space
Ignore whitespace when comparing lines.
--ignore-blank-lines
Ignore changes whose lines are all blank.
--find-renames=
Detect renames, optionally setting the similarity index threshold.
--raw
Output in raw format.
--patch
Generate patch format output.
--stat
Generate diffstat-style output.
--summary
Output a condensed summary of extended header information such as file creations or deletions.
--name-only
Show only names of changed files.
--name-status
Show only names and status of changed files.
--abbrev=
Abbreviate object names to
--no-ext-diff
Disallow external diff drivers.
--text
Treat all files as text.
--no-textconv
Do not allow text conversion filters to be run.
--ignore-submodules[=
Ignore changes to submodules, the
--relative[=
Display the path as relative to the given path. If no path is specified, display the path relative to the top of the working tree.
--src-prefix=
Show the given source prefix instead of "a/".
--dst-prefix=
Show the given destination prefix instead of "b/".
--line-prefix=
Prepend an additional prefix to every line of output.
-z
Separate file names with NUL characters.
--
Marks the end of options; subsequent arguments are treated as file names.
Limit the diff to the specified files or directories.
DESCRIPTION
The git-diff-files
command is a plumbing command in Git that compares the indexed files (staging area) against the files in the working directory. It identifies differences that have been made to the files tracked by Git but haven't yet been added to the staging area using git add
. This is useful for checking what modifications you've made since the last time you staged your changes. Unlike git diff
without arguments, git-diff-files
does not involve the commit history; it strictly compares the index (staging area) content with your working directory files. The command outputs a patch-like format detailing the added, deleted, or modified lines between the two versions. This facilitates reviewing changes before adding them to the index.
CAVEATS
This command operates directly on the filesystem and the index. Therefore, it's essential to understand that changes made directly to files in the working directory that haven't been staged will be reflected in the output. Also, because this command works on the file system, permission changes will show up in the output as well.
EXIT STATUS
The command exits with non-zero status if any differences are found; otherwise, it exits with zero status, unless the --quiet option is used.
SEE ALSO
git-diff(1), git-status(1), git-add(1)