Skip to content

Instantly share code, notes, and snippets.

@mybuddymichael
Created September 3, 2011 21:44
Show Gist options
  • Save mybuddymichael/1191833 to your computer and use it in GitHub Desktop.
Save mybuddymichael/1191833 to your computer and use it in GitHub Desktop.
Keep GitHub pages synced with 'master'
#!/usr/bin/env sh
if [ $(git symbolic-ref HEAD 2> /dev/null) = "refs/heads/master" ]
then
git checkout gh-pages
git merge master
git checkout master
fi
@mybuddymichael
Copy link
Author

I have a CoffeeScript game project that uses a simple index.html file to run the app. I use GitHub pages as a demo for the app, therefore I always want my gh-pages branch in-sync with master. This is my post-commit hook to make it happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment