Skip to content

Instantly share code, notes, and snippets.

@devth
Created February 25, 2012 22:01
Show Gist options
  • Save devth/1911106 to your computer and use it in GitHub Desktop.
Save devth/1911106 to your computer and use it in GitHub Desktop.
# Checkout first git revision before a given date
# Example usage: gcodate 2011-06-20
# Note that HEAD must be at a commit *after* the date you're targeting.
gcodate(){ git checkout "`git rev-list HEAD -n 1 --first-parent --before=$@`" && git show HEAD --stat }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment