This assumes your server is accessible via SSH.
- On your server, create the folder you want to deploy to, and initialize a Git repo in it:
mkdir my-project cd my-project git init
- Configure that Git repo to update the current branch upon deployment:
git config receive.denyCurrentBranch updateInstead
- In your local project folder, add the server as a Git remote.
git remote add production ssh://email@example.com/var/www/my-project
- To do a deployment:
git push deploy
For info on how to execute commands upon deployment, see Pete Coop’s post.