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

Re: Question: is there a short way to merge the last commit to the second last one?

From
Aditya Garg <gargaditya08@live.com>
Date
Jun 9, 2025, 10:35 UTC
Message-ID
<PN3PR01MB9597E099CDCBEACF395866DFB86BA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
In-Reply-To
<bf6b2d49-d2c6-4197-99ae-06401093c8b8@gmail.com>
Show 13 quoted lines
> On 9 Jun 2025, at 3:34 PM, Phillip Wood <phillip.wood123@gmail.com> wrote:
> 
> On 08/06/2025 20:31, Phillip Wood wrote:
>>> On 08/06/2025 19:57, brian m. carlson wrote:
>>> 
>>> If your goal is to just do the fixups and squash and not anything else
>>> interactive, then you can do this:
>>> 
>>>      GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash
>> Just a quick note to say that since git v2.44.0 you can just run
>>     git rebase --autosquash
> 
> That will also rebase your branch if you don't specify a commit. When you're re-rolling a patch series it is normally preferred to keep the same base commit. You can do that by adding "--keep-base" to avoid rebasing onto the updated upstream branch.
I'll try that. Thanks.
Previous: Phillip WoodNext: Junio C Hamano
Message 9 of 10 in “Question: is there a short way to merge the last commit to the second last one?”
  1. Aditya GargJun 8, 2025
  2. brian m. carlsonJun 8, 2025
  3. Aditya GargJun 8, 2025
  4. Phillip WoodJun 8, 2025
  5. Aditya GargJun 8, 2025
  6. brian m. carlsonJun 8, 2025
  7. Aditya GargJun 9, 2025
  8. Phillip WoodJun 9, 2025
  9. Aditya GargJun 9, 2025
  10. Junio C HamanoJun 8, 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.