Skip to content

Instantly share code, notes, and snippets.

View hfmikep's full-sized avatar

Michael Love hfmikep

View GitHub Profile
@hfmikep
hfmikep / post-receive
Created June 4, 2017 23:04 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then