Last active
June 11, 2018 18:22
-
-
Save joshcummingsdesign/053a522238c71ab82cd4 to your computer and use it in GitHub Desktop.
Git post-receive hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git --work-tree=<site-directory> --git-dir=<git-repo> checkout -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to Use
mkdir example.git
cd example.git
git init --bare
nano hooks/post-receive
<site-directory>
with the full path to the working tree<git-repo>
with the full path toexample.git
chmod +x hooks/post-receive