Skip to content

Instantly share code, notes, and snippets.

@matiasinsaurralde
Last active December 5, 2016 15:37
Show Gist options
  • Save matiasinsaurralde/f83e6e11042a0a985cdf6af26eb640f7 to your computer and use it in GitHub Desktop.
Save matiasinsaurralde/f83e6e11042a0a985cdf6af26eb640f7 to your computer and use it in GitHub Desktop.
pre-push
#!/bin/sh
current_branch=$(git rev-parse --abbrev-ref HEAD)
set "master" "target/cloud" "target/stage" "target/hybrid"
exec < /dev/tty
for branch in $@
do
if [ $current_branch = $branch ]; then
echo "Have you modified the version number? (y/n) "
read -p "> " confirmation
if [ $confirmation != "y" ]; then
echo "Aborting push"
exit 1
fi
echo "Pushing to $current_branch"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment