Skip to content

Instantly share code, notes, and snippets.

@meatcar
Forked from anonymous/post-receive
Created December 11, 2012 19:36
Show Gist options
  • Save meatcar/4261385 to your computer and use it in GitHub Desktop.
Save meatcar/4261385 to your computer and use it in GitHub Desktop.
#!/bin/sh
cd ..
GIT_DIR='.git'
umask 002 && git reset --hard
@meatcar
Copy link
Author

meatcar commented Dec 11, 2012

Stick this into .git/hooks/post-receive. Now, when you push to a remote repo that has this hook, your code will be automatically pulled in. This is helpful with deploying via git.

Note: This doesn't switch branches, so make sure you push to the correct branch.

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