git hub how to know parent branch of specific branch code example
Example 1: find out a branch a parent branch git
git show-branch -a | grep '\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
Example 2: github get parent branch
git show-branch -a \| grep '\*' \| grep -v `git rev-parse --abbrev-ref HEAD` \| head -n1 \| sed 's/.*\[\(.*\)\].*/\1/' \| sed 's/[\^~].*//'