////////////////////// // REMOTE MACHINE // ////////////////////// 1. Go to remote site directory (before public_html/): 2. Code: mkdir git && cd git git init --bare cd hooks nano post-receive 3. Code for post-receive #!/bin/sh git --work-tree=/home/sitename/public_html --git-dir=/home/sitename/git checkout -f 4. Save file and continue 5. chmod +x post-receive ////////////////////// // LOCAL MACHINE // ////////////////////// 6. Go to local site directory and run the following git init git remote add origin ssh://sitename@84.45.18.210:10222/home/sitename/git 7. Add files, commit and push eg. git add -A git commit -m "First commit" git push origin master