Skip to content

Instantly share code, notes, and snippets.

View maxijonson's full-sized avatar

Tristan Chin maxijonson

View GitHub Profile
@maxijonson
maxijonson / post-commit
Created March 16, 2019 20:27
git post-commit hook to work with Heroku, Github and sensitive files
#!/bin/sh
# After each commit on master (Heroku), it will switch to the Github branch and cherry-pick that commit into it. Then, switch back to master.
# This makes the committing flow seamless so all you have to do is push (which is safer done manually than with a hook)
# IMPORTANT: ANY changes in sensitive files should be commited alone (without public changes) or the sensitive files will be cherry picked in the public branch
# To skip this cherry-picking procedure (when you add a sensitive commit), start the commit message with "NCP" e.g.: "NCP Add some secret stuff"
ERR='\e[31m'
SUCCESS='\e[32m'
WARN='\e[33m'