Skip to content

Instantly share code, notes, and snippets.

@wilrnh
Created October 27, 2015 21:27
Show Gist options
  • Save wilrnh/d368f9ef6abdf0825352 to your computer and use it in GitHub Desktop.
Save wilrnh/d368f9ef6abdf0825352 to your computer and use it in GitHub Desktop.
Git originating branch name of latest merge
git log -n1 --format="%D" $(git log --merges -n 1 --format="%P" | awk '{print $2}') | cut -c 8-
@wilrnh
Copy link
Author

wilrnh commented Oct 27, 2015

The cut part strips the origin/ prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment