Re: check if one branch contains another branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-05-07 at 23:12:09, Alexander Mills wrote:
> so it would be:
> 
> feature_branch='my_branch'  # the branch that I want to ensure is
> completely merged into origin/dev
> git merge-base  origin/dev --is-ancestor "$feature_branch"
> 
> that won't work?  since git merge-base only works with current branch?

No, that's not the case.  You can write this:

  git merge-base --is-ancestor $feature_branch origin/dev

This works from any branch and exits 0 if the branch is in origin/dev
and 1 if it is not.  In neither case does it print anything.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux