Skip to content

Instantly share code, notes, and snippets.

@saetia
Created December 21, 2011 17:16
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 saetia/1506827 to your computer and use it in GitHub Desktop.
Save saetia/1506827 to your computer and use it in GitHub Desktop.
Remote Git

On remote server as user

git init --bare ~/private/deploy.git
echo '#!/bin/sh
echo 'updating website'
GIT_WORK_TREE=/var/www/vhosts/site.diedrick.net/httpdocs/ git checkout -f' > /var/www/vhosts/site.diedrick.net/private/deploy.git/hooks/post-receive &&
chmod 755 /var/www/vhosts/site.diedrick.net/private/deploy.git/hooks/post-receive

On local machine in git repo

#add deploy remote
git remote add deploy ssh://site@spindle.bytestudios.com/var/www/vhosts/site.diedrick.net/private/deploy.git

Create a .gitignore inside your local repo of folders not to overwrite

about/
contact/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment