[core-workflow] What instructions to give for squashing PRs from the CLI?

Maciej Szulik soltysh at gmail.com
Fri Oct 7 16:10:43 EDT 2016


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 <phd at phdru.name> wrote:

> On Thu, Oct 06, 2016 at 07:43:21PM +0000, Brett Cannon <brett at 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/            phd at phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> core-workflow mailing list
> core-workflow at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/core-workflow/attachments/20161007/542ec4da/attachment.html>


More information about the core-workflow mailing list