[cmake-developers] Good way to track whether a branch has been merged into master ?

David Cole david.cole at kitware.com
Sun Sep 19 12:52:30 EDT 2010


On Sun, Sep 19, 2010 at 5:15 AM, Michael Wild <themiwi at gmail.com> wrote:

>
> On 19. Sep, 2010, at 11:03 , Alexander Neundorf wrote:
>
> > Hi,
> >
> > I'm currently cleaning up my local CMake branches.
> > What is a good way to find out whether some branch has been merged into
> > master ? Right now I was looking through "git log" to see whether the
> commits
> > are in master.
> >
> > Alex
>
> Many options come to mind:
>
> 1. just try to delete the branch with 'git branch -d <branch>'. Git will
> refuse to delete it if the branch hasn't been merged.
> 2. 'git merge-base <branch1> <branch2>' shows the last merge point, or if
> that doesn't exist the branching point.
> 3. 'git show-branch <branch1> <branch2>' shows the history of both branches
> since the last merge (that's the default, you can show more if you want).
> 4. 'git log <branch1>..<branch2>' shows all commits in <branch2> that are
> not in <branch1>.
>
> HTH
>
> Michael
>
> --
> There is always a well-known solution to every human problem -- neat,
> plausible, and wrong.
> H. L. Mencken
>
>
> _______________________________________________
> cmake-developers mailing list
> cmake-developers at cmake.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>
>
I would use:
git branch --contains <commit>

to find out if a given commit is reachable from a given branch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20100919/f6739f7d/attachment.html>


More information about the cmake-developers mailing list