Skip to content

Instantly share code, notes, and snippets.

@fernandospr
Last active August 29, 2015 14:21
Show Gist options
  • Save fernandospr/6c0b8970cfc6f087a878 to your computer and use it in GitHub Desktop.
Save fernandospr/6c0b8970cfc6f087a878 to your computer and use it in GitHub Desktop.
Git pre push script (.git/hooks/pre-push)
#!/bin/bash
CMD="mvn test" # Run the tests before pushing
$CMD
RESULT=$?
if [ $RESULT -ne 0 ]; then
echo "Failed $CMD"
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment