title: In git, how to create a branch with commits from branch A, minus commits from B, plus commits from C?
body: <p>I have a local branch called <code>local</code>, that tracks <code>origin.master</code> but has a few commits that help with debugging and that are meant to never be pushed.</p>
  <p>When I work on a feature, I start my <code>feature</code> branch from <code>local</code>. Then, when it is ready to be pushed, I want to get rid of my local commits, hence I want:<br />
  <code>commits(A) - commits(B) + commits(C)</code> (from the question title)<br />
  or more precisely:<br />
  <code>commits(feature) - commits(local) + commits(origin.master)</code>.<br />
  This looks a bit like a <code>git rebase</code>, but not quite.</p>
  <p>Any ideas? One might be able to find how to do this online, but I don't know what to search for, this is why I'm asking here. Thanks.</p>