Skip to content

Instantly share code, notes, and snippets.

@vikytech
Last active January 13, 2018 09:30
Show Gist options
  • Save vikytech/d1047c41b181e12d9d41fe5a50a7cdfb to your computer and use it in GitHub Desktop.
Save vikytech/d1047c41b181e12d9d41fe5a50a7cdfb to your computer and use it in GitHub Desktop.
Git pre push hook
#!/bin/bash
#Example
#cd ../performance-suite
#sh run.sh
#OUT=$?
#cd -
#if [ $OUT -eq 1 ]; then
# echo "\033[31m Gatling failed with exit code $OUT"
# echo "\033[41m Push Rejected."
# exit 1
#fi
#exit 0
#!/usr/bin/env bash
if [ ! -x .git/hooks/pre-push ]
then
echo "\033[33m Setting Up Git pre push Hook......"
mkdir -p .git/hooks/
else
echo "\033[36m Updating Git pre-push Hook......"
fi
cp pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
echo "\033[32m Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment