Last active
March 12, 2020 09:05
-
-
Save laidbackware/25d7deae970c16ed26669f7004ad0b78 to your computer and use it in GitHub Desktop.
Find parent branch
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
#!/bin/bash | |
git show-branch -a \ | |
| 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