Shell/Bash: find the parent branch of a git branch Example

By

Shell/Bash Example: This is the "find the parent branch of a git branch" Example. compiled from many sources on the internet by SimpleTutorials.org

find the parent branch of a git branch

git log --first-parent

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/[\^~].*//'


* Summary: This "find the parent branch of a git branch" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others