Using git to fetch changes from testing version to live website
I would use a post-update hook that will pull changes into the webroot and perhaps also run some other commands like clearing the caches etc.

First you need to create a bare repository:

mkdir /var/git/&lt;repo-production.git&gt;
cd /var/git/&lt;repo-production.git&gt;
git init --bare
cp hooks/post-update.sample hooks/post-update
chmod +x hooks/post-update


You then need to modifiy your post-update to something like:

#!/bin/sh
cd /var/www/&lt;your_www_root&gt; || exit
unset GIT_DIR
git pull hub master
# if you have drush installed you clear caches here
# drush cc all
exec git update-server-info


Then you need to clone out the repository in your webroot:

cd /var/www
git clone /var/git/&lt;repo-production.git&gt; &lt;your_www_root&gt;
cd &lt;your_www_root&gt;
git remote rename origin hub


Then on your local machine you add the remote like this:

git remote add production ssh://root@example.com:/var/git/&lt;repo-production.git&gt;


Of course you need to change the above to match your own username, hostname and path to your repository.

You should now be able to push changes to the remote repository, than in turn will deploy any changes into the webroot.

git push production


Notice that you can setup another bare repository for your staging environment and modify the above so it checkout the code to a different location. A nice approach would then be to add it using git remote add staging &lt;path_to_staging_repoistory&gt;. Done this you are able to push your code either to production using git push production or to staging using git push staging.