Created
November 6, 2012 04:30
-
-
Save jasonkarns/4022554 to your computer and use it in GitHub Desktop.
Post Checkout git hook to remind me about running certain commands when appropriate files have been modified
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if git diff-tree --name-only --no-color -r -m $1 $2 | fgrep -e 'Gemfile' >/dev/null 2>&1 | |
then | |
echo "\nGemfile modified: run \`bundle install\`\n" | |
fi | |
if git diff-tree --name-only --no-color -r -m $1 $2 | fgrep -e 'db/migrate' -e 'db/schema.rb' -e 'db/structure.sql' >/dev/null 2>&1 | |
then | |
echo "\nSchema modified: run \'rake db:migrate\'\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment