- create repositories
git init --bare weduz.git
- create web directori
mkdir /var/www/weduz
3.enter hook directory
cd weduz.git/hooks/
- create file
nano post-receive
- write this code
#!/bin/sh
git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f
- change permission
chmod +x post-receive
- clone it on local machine
git clone ssh://[email protected]/var/repo/weduz.git
- add some files and push
nano index.php
git add index.php
git commit -m 'add index file'
git push
- check on work tree
cd /var/www/weduz
ls
- if there is file index.php then job has done :p