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

Re: git merge --no-commit <branch>; does commit

From
Alex Riesen <raa.lkml@gmail.com>
Date
Dec 16, 2007, 10:53 UTC
Message-ID
<20071216105311.GA2937@steel.home>
In-Reply-To
<alpine.LSU.0.99999.0712152124220.5151@castor.milkiway.cos>
Michael Dressel, Sat, Dec 15, 2007 21:33:20 +0100:
Show 17 quoted lines
> On Sat, 15 Dec 2007, Alex Riesen wrote:
>> Michael Dressel, Sat, Dec 15, 2007 19:14:48 +0100:
>>>> Maybe. Or maybe you misunderstood the meaning of --squash, which also
>>>> is not a merge.
>>>
>>> Since "git merge --squash <branch>" does a merge of <branch> into the
>>> working tree why would you not call it a merge?
>>
>> Because merge, in Git language, means connection histories. That one
>> just mixes the text. That's different operation, kind of editing a
>> file.
>
> That's a nice clarification. In my case I wanted that "just mixes the text" 
> thing because I did aggressively do commits during development trying out 
> slightly different approaches and being able to go back to compare them. 
> These different games are not interesting to keep in the history once a 
> good solution has been found.

In this case --squash is almost right. "rebase -i" (interactive rebase) still better: it'll allow you rebuild the development history in a more fine-grained way. It can reorder commits, "mix" them together, edit commit messages or just delete them altogether. Try it, by the look of your situation you'll like it. Actually, it is exactly why Johannes wrote it.

Previous: Michael Dressel
Message 14 of 14 in “git merge --no-commit <branch>; does commit”
  1. Michael DresselDec 13, 2007
  2. Alex RiesenDec 13, 2007
  3. Alex RiesenDec 13, 2007
  4. Michael DresselDec 13, 2007
  5. Alex RiesenDec 14, 2007
  6. Michael DresselDec 15, 2007
  7. Björn SteinbrinkDec 15, 2007
  8. Jakub NarebskiDec 15, 2007
  9. Michael DresselDec 15, 2007
  10. Jakub NarebskiDec 15, 2007
  11. Michael DresselDec 15, 2007
  12. Alex RiesenDec 15, 2007
  13. Michael DresselDec 15, 2007
  14. Alex RiesenDec 16, 2007

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.