[vtk-developers] Git tool for tracing merged branches?

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Oct 8 09:24:52 EDT 2010


On Fri, Oct 8, 2010 at 9:20 AM, David Gobbi <david.gobbi at gmail.com> wrote:

> On Fri, Oct 8, 2010 at 6:59 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> >
> > Thanks for all the answers.  I think that I asked the wrong question,
> > though.  What I meant to ask was: after a branch has been merged and
> > deleted, can it be reconstructed?  I.e. is there a git command to find
> > all the merge commits, and extract the commits they point to?
>
> As an example, after a topic branch has been merged upstream and deleted,
> how can it be reconstructed so that it can be merged into an existing
> release branch?


You can quite simply re-create a topic branch, as long as you know the final
hash at the tip of the topic branch. I have done this to then fix some bug
introduced in a topic branch, and merge it back in, or merge it into an
alternate integration branch. You want to find the has before the merge (it
will be one of the two parents listed),

git checkout -b topic-branch-recreated abcdef12

That will create, and checkout, a topic branch called
'topic-branch-recreated' that begins at commit abcdef12, if that was the tip
of the topic branch it will be entirely identical to that topic branch (you
are just creating a named pointer to a hash). You can easily find the has by
inspecting history,

git log --graph

Hope that helps.

Marcus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20101008/0c1f4d6d/attachment.html>


More information about the vtk-developers mailing list