This is a simple way to deploy to a remote server, more for my reference than anything else.
Create a new folder on the server and initialise a bare git repository in it.
Create a post-receive hook (
nano /hooks/post-receive) with this as the contents:
Make sure to create the public directory if it doesn’t already exist. Then add the remote to your local repo.
git remote add live ssh@server:/root/repos/project-name