Closed hotoo closed 7 years ago
Find the parent branch of a git branch
#!/usr/bin/env zsh branch=`git rev-parse --abbrev-ref HEAD` git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
git merge-base mybranch master
git show-branch --merge-base
2.7.0
Find the parent branch of a git branch
git merge-base mybranch master
git show-branch --merge-base