Also see: https://gist.github.com/lemiorhan/8912188
Here are the simple steps needed to push your local git repository directly to a remote (e.g. prod) server over ssh. This is based on Digital Ocean's Tutorial.
You are developing in a working-directory on your local machine, let's say on the master
branch. Usually people push code to a remote
server like github.com or gitlab.com and pull or export it to a production server. Or you use GitHub's webhooks to send a POST request to a webserver to take appropriate actions such as cloning/checking out a branch on the remote (prod) server.