From: Alexander Mills Date: Thu, 07 May 2020 23:15:12 GMT Subject: Re: check if one branch contains another branch Message-ID: In-Reply-To: I tried this: git checkout origin/dev # now in detached head state git branch --contains "$(git rev-parse "$feature_branch")" and I got this output: not sure what that means On Thu, May 7, 2020 at 4:12 PM 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? > > On Thu, May 7, 2020 at 4:08 PM Junio C Hamano wrote: > > > > Alexander Mills writes: > > > > > I am looking for a command: > > > > > > 1> if branch x contains branch y > > > > > > right now all I can find is > > > > > > 2> if current branch contains commit y > > > > > > can someone please accomplish #1 ? > > > > Study "git merge-base --is-ancestor" perhaps? > > > > -- > Alexander D. Mills > New cell phone # (415)730-1805 > linkedin.com/in/alexanderdmills -- Alexander D. Mills New cell phone # (415)730-1805 linkedin.com/in/alexanderdmills