Git Branch Parent

When asked to update a PR I had made a while back, I couldn\’t remember if I had based the PR on the master branch or the develop branch for the next major version. I\’d usually go with git branch --merged; since there had been commits made to both branches, this didn\’t work as they both would have shown up as not merged.

This stackoverflow question has interesting information (and a lot of it). As a simple copy & paste command I liked this one the best:

git show-branch \
| sed "s/].*//" \
| grep "\*" \
| grep -v "$(git rev-parse --abbrev-ref HEAD)" \
| head -n1 \
| sed "s/^.*\[//"

These five "life-changing git aliases" didn\’t answer the question I had, but it\’s a valuable git alias collection nonetheless.