Skip to content

Instantly share code, notes, and snippets.

@kyubuns
Created October 25, 2018 03:54
Show Gist options
  • Select an option

  • Save kyubuns/9a23b29a48acf1c5a48249cdbf00f6cb to your computer and use it in GitHub Desktop.

Select an option

Save kyubuns/9a23b29a48acf1c5a48249cdbf00f6cb to your computer and use it in GitHub Desktop.
gitのpre-commitでコミットしたらいけないコードを防ぐやつ
if git commit -v --dry-run | grep 'no commit' > /dev/null 2>&1
then
echo "Trying to commit non-committable code."
exit 1
else
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment