I did git checkout -b my_branch
to create a new branch some days ago.
But funnily enough I do not remember now from which branch I created my_branch.
How can I find this?
I found this command:
git show-branch -a 2>/dev/null \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| perl -ple 's/\[[A-Za-z]+-\d+\][^\]]+$//; s/^.*\[([^~^\]]+).*$/$1/'
here: https://gist.github.com/joechrysler/6073741.
It gives back a reasonable output when I run but I want be sure that this is actually the right answer.
Does this command above work or there is another command?