Skip to content

Instantly share code, notes, and snippets.

@drobinson
Created July 13, 2015 21:20
Show Gist options
  • Save drobinson/c04d3cb3116d6e2f007a to your computer and use it in GitHub Desktop.
Save drobinson/c04d3cb3116d6e2f007a to your computer and use it in GitHub Desktop.
Filter git diff by change type

--diff-filter=[ACDMRTUXB*]

Select only files that are

  • A Added
  • C Copied
  • D Deleted
  • M Modified
  • R Renamed
  • T have their type (mode) changed
  • U Unmerged
  • X Unknown
  • B have had their pairing Broken
  • * All-or-none

Any combination of the filter characters may be used.

When * (All-or-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment