Re: Git feature request: --amend older commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/17/2012 05:47 PM, George Spelvin wrote:
With git's "commit frequently" style, I often find that I end up with a
commit that includes a typo in a comment or I forgot one call site when
updating functions or something.

And it's a few commits later before I notice the simple oops.

This is of course fixable by making a commit, rebase -i HEAD~4 (or whatever),
and marking the fixup for squashing into the previous commit.

But it would be really handy if there were a one-step command for doing this.

Something like "git commit --fixup HEAD~3", where "git commit --fixup HEAD"
would be equivalent to "git commit --amend". [...]

Have you tried "git rebase --autosquash"? It does part of what you are asking for and additionally allows multiple fixup commits to be queued up and processed in a single rebase.

Michael

--
Michael Haggerty
mhagger@xxxxxxxxxxxx
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]