Skip to content

Instantly share code, notes, and snippets.

@pcreux
Created October 6, 2017 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcreux/91960670786cbf34edb206fca9487f60 to your computer and use it in GitHub Desktop.
Save pcreux/91960670786cbf34edb206fca9487f60 to your computer and use it in GitHub Desktop.
Extract all new migrations from the current branch over to a new branch (suffixed with "-migration")
#!/bin/sh
# Extract all new migrations from the current branch over to a new branch (suffixed with "-migration")
set -ev
export branch=`git rev-parse --abbrev-ref HEAD`
git checkout master
git pull
git checkout -b $branch-migration
git checkout $branch -- db engines/*/db
git commit -m "Extract migration from $branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment