Skip to content

Instantly share code, notes, and snippets.

@DavZim
DavZim / Readme.md
Last active February 13, 2020 09:08
Simple explanation how to use git-hooks to automatically deploy your code to production

How to Deploy git to a Server using git-hooks

The following script outlines how we can use git-hooks for continuous deployment (when you push your git repository, it will automatically be deployed to the server).

Note, this script is heavily based on but slightly extends this gist, see also this explanation.

Basic idea: using git-hooks to copy the files on a target machine from a remote git repository to a specific target location.

For this, we need multiple components:

  • On the target machine (the production server)