# info > GITDIFFCORE

---
type: CommandReference
command: gitdiffcore
mode: man
section: 7
source: man-pages
---

## Quick Reference
- `-B` — break complete rewrites into delete/create pairs
- `-M` — detect renames
- `-C` — detect copies
- `-S<string>` — show changes that modify number of occurrences of a string
- `-G<regex>` — show changes with added/removed lines matching a regex
- `-O<file>` — order output by filename patterns
- `--rotate-to=<path>` — rotate output to start at a specific path
- `--pickaxe-all` — with `-S` or `-G`, show entire changeset if any file matches

## Name
gitdiffcore - Tweaking diff output

## Synopsis
`git diff-* [<options>...] [<paths>...]`

## Options
The diffcore transformations are applied in this order: `diffcore-break`, `diffcore-rename`, `diffcore-merge-broken`, `diffcore-pickaxe`, `diffcore-order`, `diffcore-rotate`. The following options control these transformations.

**Diffcore-break:**
- `-B[<n>]` — break a filepair representing a complete rewrite into delete and create pairs.  
  Break score defaults to 50% of the size of the smaller file (original or result). Customize with a number after `-B` (e.g., `-B75` for 75%).  
  A second number (e.g., `-B50/60`) sets the merge threshold for `diffcore-merge-broken` (separate delete and create pairs are merged back unless more than the given percentage of the original material was deleted; default 80%).

**Diffcore-rename:**
- `-M[<n>]` — detect renames. Similarity score defaults to 50% of the smaller file. Customize with a number (e.g., `-M8` for 80%).  
  When rename detection is on but copy and break detection are off, a preliminary step checks if files are moved across directories while keeping the same filename. If a file added to a directory is sufficiently similar to a deleted file with the same name in a different directory, they are marked as renames and excluded from the later quadratic matching step. The preliminary step uses a higher similarity threshold.
- `-C[<n>]` — detect copies in addition to renames. By default, only modified files are considered as copy sources.  
  Use `--find-copies-harder` to also consider unmodified files as copy source candidates (slower).
- `--find-copies-harder` — with `-C`, consider unmodified files as copy sources.

**Diffcore-merge-broken:**
- Runs automatically when `diffcore-break` is used. Merges broken filepairs that were not turned into renames/copies back into a single modification.  
  Merge threshold counts only deletion from the original, not insertion. Default 80% (i.e., if less than 80% of the original material was deleted, the broken pair is merged). Can be adjusted via the second number after `-B` (e.g., `-B/60`).

**Diffcore-pickaxe:**
- `-S<block of text>` — show only filepairs that change the number of occurrences of the specified string.  
  With `--pickaxe-regex`, treat `<block of text>` as an extended POSIX regular expression.
- `-G<regex>` — show filepairs whose textual diff has an added or deleted line matching the given regular expression. In-file moves are detected (which can be noise). Binary files without textconv filters are ignored to improve performance.
- `--pickaxe-all` — when used with `-S` or `-G`, keep the entire changeset (all filepairs) if any filepair matches the criterion.
- `--pickaxe-regex` — treat the argument to `-S` as a regex rather than a literal string.

**Diffcore-order:**
- `-O<orderfile>` — reorder filepairs according to a file containing shell glob patterns (one per line). Filepairs matching earlier patterns are output first; unmatched filepairs appear last.  
  Example orderfile for core Git:

  ```text
  README
  Makefile
  Documentation
  *.h
  *.c
  t
  
**Diffcore-rotate:**
- `--skip-to=<path>` — rotate output so that the filepair for the given path comes first, discarding all paths before it. If the path is not in the set, for `git log` the output starts at the first path that sorts after the given pathname.
- `--rotate-to=<path>` — rotate the output so that the given pathname is first, but do not discard any paths.  
  Combining with `diffcore-order` may produce unexpected results, as the input to this transformation is not guaranteed to be sorted.

## Examples
Example orderfile for core Git:

text
README
Makefile
Documentation
*.h
*.c
t
## See Also
- [git-diff(1)](http://localhost/phpMan.php/man/git-diff/1/markdown)
- [git-diff-files(1)](http://localhost/phpMan.php/man/git-diff-files/1/markdown)
- [git-diff-index(1)](http://localhost/phpMan.php/man/git-diff-index/1/markdown)
- [git-diff-tree(1)](http://localhost/phpMan.php/man/git-diff-tree/1/markdown)
- [git-format-patch(1)](http://localhost/phpMan.php/man/git-format-patch/1/markdown)
- [git-log(1)](http://localhost/phpMan.php/man/git-log/1/markdown)
- [gitglossary(7)](http://localhost/phpMan.php/man/gitglossary/7/markdown)
- [The Git User’s Manual](file:///usr/share/doc/git/html/user-manual.html)