Skip to content

Instantly share code, notes, and snippets.

@ph3b
Created June 27, 2016 20:08
Show Gist options
  • Save ph3b/ce9aeef815c176e3a6f9b58dd4897f7a to your computer and use it in GitHub Desktop.
Save ph3b/ce9aeef815c176e3a6f9b58dd4897f7a to your computer and use it in GitHub Desktop.
On remote:
1. $ git init --bare
2. $ touch ./hooks/post-receive
3. $ chmod +x ./hooks/post-receive
4. $ sudo nano ./hooks/post-receive
Paste
```
#!/bin/bash
echo "Hello :) "
git --work-tree=/home/username/var/www/domain.com --git-dir=/home/username/repo/domain.git checkout -f
```
On local:
$ git remote add live ssh://username@ip/home/username/repo/domain.git
$ git push live master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment