Skip to content

Instantly share code, notes, and snippets.

@foxxyz
Last active December 21, 2015 18:29
Show Gist options
  • Save foxxyz/6347587 to your computer and use it in GitHub Desktop.
Save foxxyz/6347587 to your computer and use it in GitHub Desktop.
Post-receive git hook for deploying remote repositories with a working tree.
#!/bin/sh
cd ..
GIT_DIR='.git'
git stash
umask 002 && git reset --hard && git submodule update --recursive
git stash pop
# Run compass to recompile
bash util/recompile_sass.sh
@foxxyz
Copy link
Author

foxxyz commented Aug 26, 2013

If the repository is not a bare repository, make sure to set receive.denycurrentbranch to ignore or git will throw up a bunch of warnings when pushing to the remote server:

git config receive.denycurrentbranch ignore

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