Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#server side:
#server live directory: /var/www/
#server repository: /var/repo/site.git
1. clone project from git/bitbucket into /var/www/ or init the folder by "git init".
2. go to /var/repo/site.git and init the folder as git bare
$git init --bare
--bare means that our folder will have no source files, just the version control.
3. still in site.git folder go to hooks.
$cd hooks
$cat > post-receive # When you execute this command, you will have a blank line indicating that everything you type will be saved to this file
git --work-tree=/var/www/ --git-dir=/var/repo/site.git checkout -f
4. $chmod +x post-receive
#Local workspace:
1. go to your "git" project folder.
2. $git remote add live ssh://
3. after any changes. remrember "push" to both live and master
$git push
$git push live
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment