Skip to content

Instantly share code, notes, and snippets.

@jcf
Created October 8, 2010 08:28
Show Gist options
  • Save jcf/616504 to your computer and use it in GitHub Desktop.
Save jcf/616504 to your computer and use it in GitHub Desktop.
Get the version of the last staged migration in db/migrate
git ls-files --stage -- db/migrate | xargs -I x basename x | awk ' END { split($1, a, "_"); print a[1] } '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment