Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created November 25, 2012 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwenzel/4145136 to your computer and use it in GitHub Desktop.
Save pwenzel/4145136 to your computer and use it in GitHub Desktop.
Git Post Receive Deployment Hook (pulls latest, then saves deployment log and current version to file)
#!/bin/sh
cd /path/to/project/ || exit
unset GIT_DIR
LOGFILE=deployments.log
echo $(date) >> $LOGFILE
git pull origin master >> $LOGFILE
git update-server-info
echo $(git rev-parse --short HEAD) > VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment