Skip to content

Instantly share code, notes, and snippets.

@eet-nu
Created December 28, 2009 11:16
Show Gist options
  • Save eet-nu/264631 to your computer and use it in GitHub Desktop.
Save eet-nu/264631 to your computer and use it in GitHub Desktop.
$ cat .git/hooks/post-checkout
#! /bin/sh
# Start from the repository root.
cd ./$(git rev-parse --show-cdup)
branch=`git branch | grep '*' | cut -d" " -f2`
if [ $3 -eq 1 ]
then
cp config/${branch}.database.yml config/database.yml
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment