reset hard on git push

The issue is a difference in how Git commands behave in the environment created for hook scripts versus your normal environment. First, hook scripts run with their current working directory set to the Git directory itself (i.e. the .git/ directory of a non-bare repository). Second, hook scripts run with the GIT_DIR environment variable set and … Read more

Git Post-Receive Hook for Website Staging

The answer to your question is here: http://toroid.org/ams/git-website-howto In short, what you want to do is add a “detached work tree” to the bare repository. Normally you think of your work tree as containing the .git directory. Bare repositories do not have a work tree by definition, but you can create one as long as … Read more