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

Re: Any way to "flatten" a series of changes in git

From
Howard Miller <howard@e-learndesign.co.uk>
Date
Oct 22, 2009, 21:24 UTC
Message-ID
<26ae428a0910221424n9f45d9bg379fb6609b4eace0@mail.gmail.com>
In-Reply-To
<26ae428a0910221411l73aa7cbak5c060925ccdf4cea@mail.gmail.com>
2009/10/22 Howard Miller <howard@e-learndesign.co.uk>:
Show 13 quoted lines
>> You can use either "git merge --squash" or "git rebase --interactive"
>> (changing 'pick' to 'squash').
>>
>
> Actually thinking some more.... I don't understand something about
> this. I don't actually want to merge or rebase with anything. I just
> want to say "make those commits a series of commits on a branch into
> just one commit with a new message". I seriously suspect I'm missing
> the point somewhere but what has that got to do with merging or
> rebasing?
>
> Thanks again
>
Oh..... more reading of the help. It's this I take it...
" For example, if you want to reorder the last 5 commits, such that
what was HEAD~4 becomes the new HEAD. To achieve that, you
       would call git-rebase like this:
           $ git rebase -i HEAD~5"

Would it be ungrateful to suggest that the existence of that option isn't clear from the synopsis at the start of the help? :-) I guess I can put the SHA1 identifier of the first commit in my branch too? Anyway, I'll go and try it and see what happens.

Previous: Howard MillerNext: Jakub Narebski
Message 9 of 14 in “Any way to "flatten" a series of changes in git”
  1. Howard MillerOct 22, 2009
  2. Bill LearOct 22, 2009
  3. Bill LearOct 22, 2009
  4. Jacob HelwigOct 22, 2009
  5. Howard MillerOct 22, 2009
  6. Daniele SegatoOct 26, 2009
  7. Jakub NarebskiOct 22, 2009
  8. Howard MillerOct 22, 2009
  9. Howard MillerOct 22, 2009
  10. Jakub NarebskiOct 22, 2009
  11. Howard MillerOct 23, 2009
  12. Howard MillerOct 23, 2009
  13. Johannes SixtOct 23, 2009
  14. Junio C HamanoOct 23, 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.