Created
March 13, 2012 20:55
-
-
Save jhthorsen/2031515 to your computer and use it in GitHub Desktop.
post-receive hook for git
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
#!/bin/sh | |
BACKUP=$GIT_DIR; # need to be first? | |
GIT_DIR="path/to/my/repo/.git"; | |
while read oldrev newrev refname; do | |
BRANCH=$(echo $refname | cut -f3 -d/); | |
echo branch $BRANCH | |
if [ "x$BRANCH" = "xalien" ]; then | |
cd $GIT_DIR; | |
/usr/bin/git merge $BRANCH; | |
fi | |
done | |
GIT_DIR=$BACKUP; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment