Created
June 1, 2017 17:13
-
-
Save treshugart/63aa4dda064c7d94dbf216c369088ef4 to your computer and use it in GitHub Desktop.
Returns the branch that a given branch was branched off of with acceptable accuracy. Obviously it doesn't work for master.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment