Skip to content

Instantly share code, notes, and snippets.

@priithaamer
Created September 23, 2010 08:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priithaamer/593362 to your computer and use it in GitHub Desktop.
Save priithaamer/593362 to your computer and use it in GitHub Desktop.
Git post-receive file to update contents in another directory on the same server.
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
WORKDIR="/some/git/repo/workdir"
export GIT_DIR=$WORKDIR/.git
pushd $WORKDIR > /dev/null
git pull
popd > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment