title: Stacked PR rebase / amend workflow
body: <p>I have the following workflow for doing stacked pull requests in git (I like to do lots of small, dependent PRs):</p>
  
  <pre><code>* Start your feature_b from feature_a, i.e.:
  git checkout feature_a
  git checkout -b feature_b
  * Whenever feature_a changes while it is waiting to get merged into master, you rebase feature_b on it:
  ... commit something onto feature_a ...
  git checkout feature_b
  git rebase feature_a
  * Finally, as soon as feature_a has been merged into master, you simply get the new master and rebase feature_a onto it a last time:
  git checkout master
  git pull origin master
  git checkout feature_b
  git rebase --onto master feature_a feature_b
  </code></pre>
  
  <p>This works for a few dependencies, but after I get to around <code>feature_c</code> or d, I end up have to rebase a bunch of times if I want to change something in the <code>feature_a</code> branch. Ideally I want a “amend this commit and rebase all dependent commits onto it” command to run when I edit a given PR, as well as a "rebase all but the first x commits onto master" command when I merge one or more of the initial PRs and still have the rest in review.</p>
  
  <p>When I used mercurial, I used <code>hg amend --rebase</code> (<a href="https://bitbucket.org/facebook/hg-experimental" rel="nofollow noreferrer">https://bitbucket.org/facebook/hg-experimental</a>) to do this for me. Curious if there’s an equivalent in git or a script I could write to implement the same functionality?</p>
  
  <p><a href="https://git-scm.com/docs/git-rerere" rel="nofollow noreferrer">rerere</a> looks like it could be a good tool to use here, in conjunction with other things to automate the dependent rebase process itself.</p>