Skip to content

Instantly share code, notes, and snippets.

@seeliang
Created July 20, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seeliang/22ac0ed62de954586680881634922db3 to your computer and use it in GitHub Desktop.
Save seeliang/22ac0ed62de954586680881634922db3 to your computer and use it in GitHub Desktop.
Run script based on git diff and path
if ! git diff-index --quiet --relative=src HEAD^; # with compare git diff target (HEAD^) and path (src)
then
echo has change;
# run
else
echo no change
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment