Created
January 25, 2017 13:35
-
-
Save dibmartins/ef6688bda1b9e9056d3db9491247cefd to your computer and use it in GitHub Desktop.
Deploy with git bare
This file contains hidden or 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
sudo su | |
cd /var | |
mkdir repo && cd repo | |
mkdir site.git && cd site.git | |
git init --bare | |
cd hooks | |
cat > post-receive | |
#!/bin/sh | |
git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f | |
chmod +x post-receive | |
// Add remote on your local project | |
git remote add live ssh://[email protected]/var/repo/site.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment