Created
November 12, 2016 18:09
-
-
Save alexander-bauer/0f6d2768b5c40b1e156e8f054bb50494 to your computer and use it in GitHub Desktop.
Git post-receive hook for updating a non-bare repository when pushed to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THISFILE="$(pwd)/$0" | |
REPODIR=$(dirname $(dirname $(dirname "$THISFILE"))) | |
# Notify the user that we are updating HEAD. | |
echo -e "\033[32m" | |
echo "Updating HEAD for you." | |
echo git --git-dir "$REPODIR/.git" --work-tree "$REPODIR/" reset --hard master | |
echo -e "\033[0m" | |
git --git-dir "$REPODIR/.git" --work-tree "$REPODIR/" reset --hard master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment