I usually go with the visual version which goes like this:

1. git rebase -i HEAD~2 (where 2 means here 2 previous commits)
2. now in editor you can pick which commit can be squashed to which (all
nicely described)
3. mark 2nd commit, which will be squashed to previous with squash, write
changes and exit
4. now you can tweak the log message (both are shown), write changes and
exit

You're left with just single commit.


On Fri, Oct 7, 2016 at 1:35 PM, Oleg Broytman <p...@phdru.name> wrote:

> On Thu, Oct 06, 2016 at 07:43:21PM +0000, Brett Cannon <br...@snarky.ca>
> wrote:
> > While we will use GitHub's Squash and Merge button for PRs, that doesn't
> > meant everyone will want to use it; some people just prefer using a CLI.
> > That means we need to come up with a set of instructions on how to take a
> > GitHub PR and perform a squash commit manually at the CLI (committing a
> > patch from bugs.python.org is simply since there's no squashing to do).
> > Anyone have that set of commands handy?
>
> It's something like::
>
>     $ git fetch github pull/$ID/head:$BRANCHNAME
>     $ git checkout master
>     $ git merge --squash $BRANCHNAME
>     $ git branch -d $BRANCHNAME
>
> Oleg.
> --
>      Oleg Broytman            http://phdru.name/            p...@phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> core-workflow mailing list
> core-workflow@python.org
> https://mail.python.org/mailman/listinfo/core-workflow
> This list is governed by the PSF Code of Conduct:
> https://www.python.org/psf/codeofconduct
>
_______________________________________________
core-workflow mailing list
core-workflow@python.org
https://mail.python.org/mailman/listinfo/core-workflow
This list is governed by the PSF Code of Conduct: 
https://www.python.org/psf/codeofconduct

Reply via email to