Skip to content

Instantly share code, notes, and snippets.

@MaxXx1313
Created June 4, 2020 21:49
Show Gist options
  • Save MaxXx1313/f1d2f14030890215269763aac2705d45 to your computer and use it in GitHub Desktop.
Save MaxXx1313/f1d2f14030890215269763aac2705d45 to your computer and use it in GitHub Desktop.
git check if any file is changed
#
hasChanges=$(git diff-index --name-only HEAD --)
if [ -n "$hasChanges" ]; then
echo -e "*** Git repository is not clean!"
gitSha="$gitSha-DIRTY"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment