Re: RFC: git squash
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 23, 2018, 06:04 UTC
- Message-ID
- <xmqqfu5sutrc.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAA7Zk=tMMPE_Ov6cSJuzgYwWmTuMTSd_909c5JY3a2k5KFzHgQ@mail.gmail.com>
Julius Musseau <julius@mergebase.com> writes:
Show 15 quoted lines
> git squash [<commit>]
>
> Squashes <commit>..HEAD into a single commit. Replaces HEAD with the
> result. If not specified, <commit> defaults to the current branch's
> upstream (a.k.a. @{upstream}).
>
> Rationale:
>
> This command provides an intuitive mechanism for in-place squash that
> doesn't drop dirty merge results.
>
> We call this an in-place squash because the state of all files and
> directories at HEAD does not change. Only the ancestory of HEAD
> changes: its (only) parent becomes the merge-base of <commit> and
> HEAD, removing all intermediate commits.So is it essentially the same as
git reset --soft $(git merge-base $commit HEAD)
git commitwith some icing for coming up with a default log message? The above won't touch the working tree at all.