Skip to content

Instantly share code, notes, and snippets.

@magnusstahre
Forked from jasonkarns/post-checkout
Created November 6, 2012 04:48
Show Gist options
  • Save magnusstahre/4022642 to your computer and use it in GitHub Desktop.
Save magnusstahre/4022642 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
#!/bin/sh
if ! git diff-tree --quiet $1 $2 -- Gemfile
then
echo "\nGemfile modified: run \`bundle install\`\n"
fi
if ! git diff-tree --quiet $1 $2 -- db/migrate db/schema.rb db/structure.sql
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