<div class="gmail_quote">On Fri, Oct 8, 2010 at 9:20 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, Oct 8, 2010 at 6:59 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
><br>
> Thanks for all the answers. I think that I asked the wrong question,<br>
> though. What I meant to ask was: after a branch has been merged and<br>
> deleted, can it be reconstructed? I.e. is there a git command to find<br>
> all the merge commits, and extract the commits they point to?<br>
<br>
</div>As an example, after a topic branch has been merged upstream and deleted,<br>
how can it be reconstructed so that it can be merged into an existing<br>
release branch?</blockquote><div><br></div><div>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),</div>
<div><br></div><div>git checkout -b topic-branch-recreated abcdef12</div><div><br></div><div>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,</div>
<div><br></div><div>git log --graph</div><div><br></div><div>Hope that helps.</div><div><br></div><div>Marcus</div></div>