Skip to content

Instantly share code, notes, and snippets.

@erwstout
Created June 13, 2017 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erwstout/b9f90678cf7e55adc7decf92a38fa773 to your computer and use it in GitHub Desktop.
Save erwstout/b9f90678cf7e55adc7decf92a38fa773 to your computer and use it in GitHub Desktop.
Deploy remote Git Repo
## - Create the repo on the server
mkdir repo && cd repo
mkdir site.git && cd site.git
git init --bare
## - Navigate to the repo Hooks folder to setup remote paths
cd hooks
cat > post-receive
## - Set remote paths that we will be working with
#!/bin/sh
git --work-tree=/home/accountname/public_html/wp-content/themes/themename --git-dir=/home/accountname/repos/site.git checkout -f
## control - d to save and close
## - Then we need to set the permissions correctly
chmod +x post-receive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment