Skip to content

Instantly share code, notes, and snippets.

View JasonCust's full-sized avatar
🍺
Hold my beer…

Jason Cust JasonCust

🍺
Hold my beer…
View GitHub Profile
@JasonCust
JasonCust / post-merge
Last active May 20, 2016 18:31 — forked from sindresorhus/post-merge
A git hook to run checks and commands automatically after `git pull`
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files=$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)
check_run() {
echo "${changed_files}" | grep --quiet "$1" && eval "$2"