title: Git: Better way to rebase 3rd branch onto 1st branch after 2nd branch merged
body: <p>I have a branch with a big feature, that we can call A, and I created a branch B from last commit of A.</p>
  
  <p>After some time I create a Pull Request in Github to merge B onto A. But because I do not want to wait, I create a branch C from B before it is merged.</p>
  
  <pre><code>[A] a---b---c---c1---c2
              \(A)
  [B]           d---e---f
                        \(B)
  [C]                     g---h
  </code></pre>
  
  <p>I committed on C, and meanwhile branch B has been merged onto A. So I want to cleanup my work and update my local A by pulling it from origin so I can have this situation:</p>
  
  <pre><code>[A] a---b---c---c1---c2---d---e---f
                                    \(A)
  [C]                                 g---h
  </code></pre>
  
  <p>Now, here is my issue: I want C to be rebased onto A, but as B has been merged and removed (even locally because I pulled), so in order to rebase it I cannot do something like:</p>
  
  <pre><code>git rebase B C --onto A
  </code></pre>
  
  <p>But B does not exist anymore so when I git log, this is basically what I have:</p>
  
  <pre><code>[A]a---b---c---c1---c2
  
  [C] d'---e'---f'---g---h
  
  
  (This is what I have to do in order to rebase)
  
  git rebase f' C --onto A
  
  </code></pre>
  
  <p>This works but I need to verify the hash of the last commit from B I can guess from C (here it is <strong>f'</strong>), and I may make mistakes here (and this looks ugly, like if all commits from B always have been on ).</p>
  
  <p>Is there a better way to rebase C onto A after B has been merged ? Maybe I have to do something before pulling A?</p>
  
  <p>If this is not clear enough please let me know (I do not ask questions often here! :) )</p>