<div dir="ltr"><div><div><div><div><div>I usually go with the visual version which goes like this:<br><br></div>1. git rebase -i HEAD~2 (where 2 means here 2 previous commits)<br></div>2. now in editor you can pick which commit can be squashed to which (all nicely described)<br></div>3. mark 2nd commit, which will be squashed to previous with squash, write changes and exit<br></div>4. now you can tweak the log message (both are shown), write changes and exit<br><br></div>You're left with just single commit. <br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 7, 2016 at 1:35 PM, Oleg Broytman <span dir="ltr"><<a href="mailto:phd@phdru.name" target="_blank">phd@phdru.name</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Oct 06, 2016 at 07:43:21PM +0000, Brett Cannon <<a href="mailto:brett@snarky.ca">brett@snarky.ca</a>> wrote:<br>
> While we will use GitHub's Squash and Merge button for PRs, that doesn't<br>
> meant everyone will want to use it; some people just prefer using a CLI.<br>
> That means we need to come up with a set of instructions on how to take a<br>
> GitHub PR and perform a squash commit manually at the CLI (committing a<br>
> patch from <a href="http://bugs.python.org" rel="noreferrer" target="_blank">bugs.python.org</a> is simply since there's no squashing to do).<br>
> Anyone have that set of commands handy?<br>
<br>
</div></div>It's something like::<br>
<br>
    $ git fetch github pull/$ID/head:$BRANCHNAME<br>
    $ git checkout master<br>
    $ git merge --squash $BRANCHNAME<br>
    $ git branch -d $BRANCHNAME<br>
<span class="HOEnZb"><font color="#888888"><br>
Oleg.<br>
--<br>
     Oleg Broytman            <a href="http://phdru.name/" rel="noreferrer" target="_blank">http://phdru.name/</a>            <a href="mailto:phd@phdru.name">phd@phdru.name</a><br>
           Programmers don't die, they just GOSUB without RETURN.<br>
______________________________<wbr>_________________<br>
core-workflow mailing list<br>
<a href="mailto:core-workflow@python.org">core-workflow@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/core-workflow" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/core-workflow</a><br>
This list is governed by the PSF Code of Conduct: <a href="https://www.python.org/psf/codeofconduct" rel="noreferrer" target="_blank">https://www.python.org/psf/<wbr>codeofconduct</a><br>
</font></span></blockquote></div><br></div>