Git

Global configuration
# initial configuration
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
Init project
# init git in your project and make first commit
git init
git add .
git commit -m first
git config http.sslVerify false
add prod and dev nodes
git remote add app1 ssh://[email protected]/data/www/site.com
git remote add app1-dev ssh://[email protected]/data/www/dev.site.com
git remote add origin https://git.yourdomain/yourname/project.git
git remote -v
on prod and dev nodes make bare repos
# init
cd /data/www/site.com/
git init --bare .git
# create hook script
cat << EOF >> .git/hooks/post-receive
#!/bin/bash
git --work-tree=/data/www/site.com --git-dir=/data/www/site.com/.git checkout -f
chown -R apache. /data/www/site.com
EOF
chmod +x .git/hooks/post-receive
and the same on dev path

push content to prod or dev
git push app1 master
git push app1-dev master
push to git server
git push origin master
fetch commits
git pull origin master
versioning with tags
git tag -a v1.0.0 -m "release v1.0.0"
git push --tags