This article presents how to deploy continuously from a Git repository with high security, by creating a UNIX user whose only purpose and ability is to update a repository and execute commands from a script within the repository upon successful SSH connections.
Your server has at least Git and some SSH agent installed, and you are connected to it as root.
Just to rephrase: all these commands are to be executed on your server, as root. ssh root@YOUR_SERVER
now!