Skip to content

Instantly share code, notes, and snippets.

@hukl
Created January 27, 2010 14:36
Show Gist options
  • Save hukl/287879 to your computer and use it in GitHub Desktop.
Save hukl/287879 to your computer and use it in GitHub Desktop.
Output root of a given branch (second commit from the top of the output)
git for-each-ref refs/heads | while read sha rest; do git merge-base $sha <branchname>; done | git log --date-order --no-walk --stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment