git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Graphical tool to merge and reorder commits

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 19, 2025, 19:09 UTC
Message-ID
<9e04fa29-f5e5-450c-8a00-a67a4c230640@kdbg.org>
In-Reply-To
<xmqqplcre0el.fsf@gitster.g>
Am 19.08.25 um 18:33 schrieb Junio C Hamano:
Show 15 quoted lines
> Bernd Petrovitsch <bernd@petrovitsch.priv.at> writes:
>> On 19.08.25 10:35, R. Diez wrote:
>>> - A - B - fixA1 - C - fixA2 - D - E
>>> [...]
>>> - A+fixA1+fixA2 - B - C - D - E
>>
>> - `git rebase -i HEAD~11` (or so;-)
>> - move fixA1 and fixA2 under A and change "pick" to "fixup" for fixA1 and fixA2
>> - save and exit the editor
>>
>> And done.
> 
> I hope we all know that ;-).  But the question was if there is a GUI
> tool to let you do so without knowing how to move lines in your
> editor or how to edit "pick" and change it to "fixup", I think.

Half-GUI is to keep `gitk --branches HEAD &` open for easy diff inspection and `git gui` next to it for easy staging of (partial) changes. The workflow is then

    # fix bugs
    # git gui: stage all or partial changes
    # gitk: search commit
    git commit --fixup 123abc
    # git gui: stage more changes
    # gitk: search commit
    git commit --fixup def456
    git rebase -i --autosquash HEAD~11   # or so ;)
    # fixup commits are already at the correct positions

Bonus feature: After staging, press F5 in gitk, select the green commit ("Local changes check in to the index..."), right-click in the diff panel on a removed line[*], select "Show origin of this line", and you are right at the commit that you want to fix up.

[*] works also for context lines, but it is less obvious which one to choose.

This workflow requires useful commit message summary lines. If you have only identical silly summaries like "fix bug" or "new feature", --autosquash doesn't know which one you mean.

-- Hannes
Previous: Junio C Hamano
Message 11 of 11 in “Graphical tool to merge and reorder commits”
  1. R. DiezAug 17, 2025
  2. Konstantin KhomoutovAug 18, 2025
  3. Junio C HamanoAug 18, 2025
  4. Patrick SteinhardtAug 19, 2025
  5. R. DiezAug 19, 2025
  6. Bernd PetrovitschAug 19, 2025
  7. Patrick SteinhardtAug 19, 2025
  8. R. DiezAug 19, 2025
  9. Ben KnobleAug 19, 2025
  10. Junio C HamanoAug 19, 2025
  11. Johannes SixtAug 19, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.