Skip to content

Instantly share code, notes, and snippets.

@nstielau
Created November 21, 2011 21:19
Show Gist options
  • Save nstielau/1383974 to your computer and use it in GitHub Desktop.
Save nstielau/1383974 to your computer and use it in GitHub Desktop.
A post receive hook to sync remote non-bare repos
# First allow pushing to the checked-out branch on the remote repo:
# git config receive.denyCurrentBranch ignore
# Then add this to sync the working dir to the repo on receive:
GIT_WORK_TREE=/opt/titan GIT_DIR=/opt/titan/.git git reset --hard
# Then, on the local working dir, add the remote:
# git remote add test [email protected]:/opt/titan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment