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

Re: merging multiple commit into one?

From
Andreas Ericsson <ae@op5.se>
Date
May 11, 2009, 13:31 UTC
Message-ID
<4A0828CA.3060405@op5.se>
In-Reply-To
<1de9d39c0905110621p6858bca8y8bb036a167754672@mail.gmail.com>
jean-luc malet wrote:
Show 13 quoted lines
> Hi,
> I often commit "useless" code, for example before going into weekend
> or for saving some state during a dev process
> often thoses commit are simply useless and the commit message looks
> like "COMPILE ERROR - temporary save .... "
> at the end I have LOT of theses commits that are useless and I want to
> save some space/time/tree complexity merge multiple sequential commits
> (without branch) into one
> is it possible?
> according to my knowledge of git, removing the commit and rewriting
> the last commit log so that it better reflect the modification will do
> the job but I'm not sure git allow it...
> thanks

git commit --amend; # to extend last commit only git merge --squash; # I think. Not sure though, so read the docs git rebase -i; # replace "pick" with "squash" to combine commits.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Register now for Nordic Meet on Nagios, June 3-4 in Stockholm
 http://nordicmeetonnagios.op5.org/

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: jean-luc maletNext: Jakub Narebski
Message 2 of 10 in “merging multiple commit into one?”
  1. jean-luc maletMay 11, 2009
  2. Andreas EricssonMay 11, 2009
  3. Jakub NarebskiMay 11, 2009
  4. MALET Jean-LucMay 11, 2009
  5. Jakub NarebskiMay 11, 2009
  6. jean-luc maletMay 12, 2009
  7. Heiko VoigtMay 11, 2009
  8. MALET Jean-LucMay 11, 2009
  9. Heiko VoigtMay 12, 2009
  10. Markus HeidelbergMay 12, 2009

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.