Common diff options
suggest change| Option | Explanation |
|---|---|
| -z | Output diff-raw with lines terminated by NUL. |
| -p | Output the patch format. |
| -u | Synonym for -p. |
| --patch-with-raw | Output both a patch and the diff-raw format. |
| --stat | Show a diffstat instead of a patch. |
| --numstat | Show a numeric diffstat instead of a patch. |
| --patch-with-stat | Output a patch and prepend its diffstat. |
| --name-only | Show only the names of changed files. |
| --name-status | Show names and status of changed files. |
| --full-index | Show the full object name on index lines. |
| --abbrev= | Abbreviate object names in the diff-tree header and diff-raw. |
| -R | Swap the input file pairs. |
| -B | Detect complete rewrites. |
| -M | Detect renames. |
| -C | Detect copies. |
| --find-copies-harder | Also consider unchanged files as copy sources. |
| -l | Limit how many paths rename detection will consider. |
| -O | Reorder diffs according to the order file passed to -O. |
| -S | Find a file pair where only one side contains the string. |
| --pickaxe-all | When -S finds a hit, show the diff for every file, not only the hit. |
| -a, --text | Treat all files as text. |
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents