Created
July 18, 2012 13:47
-
-
Save stinoga/3136312 to your computer and use it in GitHub Desktop.
git post commit hook to push to remote repo
This file contains hidden or 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 | |
# This hook is used to push a mirrored version of all committed files to your remote repo after they are commited | |
# Replace this variable with your remote repo name | |
REPO=dropbox | |
echo | |
echo "==== Sending changes to $REPO repo ====" | |
echo | |
git push --mirror $REPO; | |
echo | |
echo "==== Donezo ====" | |
echo |
This file contains hidden or 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
# This script needs run in terminal to make your hook file executable. Run it wherever your repo is stored | |
chmod a+x .git/hooks/post-commit |
Ah yes. Thank you sir! All fixed up.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think line 11 should read "git push --mirror $REPO"
Very cool.