Skip to content

Instantly share code, notes, and snippets.

@mmodrow
Last active May 23, 2019 12:06
Show Gist options
  • Save mmodrow/1494a3cb36164ca095979a05191e034f to your computer and use it in GitHub Desktop.
Save mmodrow/1494a3cb36164ca095979a05191e034f to your computer and use it in GitHub Desktop.
List all files in the current git repository that changed in the current commit compared to the origin master
#! /bin/bash
filter="ACDM"
for i in "$@"
do
case $i in
-A)
filter="${filter//A}"
;;
-C)
filter="${filter//C}"
;;
-D)
filter="${filter//D}"
;;
-M)
filter="${filter//M}"
;;
esac
done
git diff --diff-filter=$filter --name-only origin/master HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment