Skip to content

Instantly share code, notes, and snippets.

@webkonstantin
Last active December 16, 2015 10:39
Show Gist options
  • Save webkonstantin/770b96f75ec4d0c8c225 to your computer and use it in GitHub Desktop.
Save webkonstantin/770b96f75ec4d0c8c225 to your computer and use it in GitHub Desktop.
post-receive example for non-bare repo
#!/bin/bash
set -e
# move to working tree dir
export GIT_DIR=$(cd ${GIT_DIR}; pwd)
GIT_WORK_TREE="${GIT_DIR}/.."
# update working dir
(
cd ${GIT_WORK_TREE}
pwd
git diff-index -R --name-status HEAD >&2
git reset --hard HEAD
# composer install
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment