2 ms·
I recommend reading the git-rev-parse(1) man page in full, it’ll give you good ideas for this sort of thing. What you’re looking for could be spelled $(git mer
by chrismorgan 6y ago
I recommend reading the git-rev-parse(1) man page in full, it’ll give you good ideas for this sort of thing.
What you’re looking for could be spelled $(git merge-base HEAD master) (that’s a subshell invocation, outputting a single commit ID). In some circumstances dotted range notation might do: master.. includes all the commits after master and HEAD diverge. That’s good for logging, for example, but not so useful for the sort of rebasing you’re describing, where you may wish to use the merge base instead.
- StavrosK 6y agoThat's helpful, thanks! I already do use merge-base, I was wondering if there's a builtin shortcut as I hadn't seen anything in the rev-parse manage.