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

Re: how to combine 2 commits?

From
Imran M Yousuf <imyousuf@gmail.com>
Date
Jan 13, 2009, 05:32 UTC
Message-ID
<7bfdc29a0901122132l38837b37h188a8f5dd5ccbbd7@mail.gmail.com>
In-Reply-To
<200901122327.21102.bss@iguanasuicide.net>

On Tue, Jan 13, 2009 at 11:27 AM, Boyd Stephen Smith Jr. <bss@iguanasuicide.net> wrote:

Show 12 quoted lines
> On Monday 12 January 2009, bill lam <cbill.lam@gmail.com> wrote about 'how
> to combine 2 commits?':
>>How to combine these 2 commits so that the changes of linefeed cancel
>>out each other and the history only shows the intended changes of the
>>few scripts.
>
> Two ways I can think of:
> git rebase --interactive (read "git help rebase" first)
> git merge --squash (read "git help merge" first)
>
> The rebase is probably semantically closer to how you are thinking about
> things right now.

Another way I can think of is - git format-patch + git apply, i.e. first generate 2 patches for the 2 commits and then apply them one on top of another.

Best regards,
Imran
Show 6 quoted lines
> --
> Boyd Stephen Smith Jr.                     ,= ,-_-. =.
> bss@iguanasuicide.net                     ((_/)o o(\_))
> ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-'
> http://iguanasuicide.net/                      \_/
>
-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557
Previous: Boyd Stephen Smith Jr.Next: bill lam
Message 4 of 9 in “how to combine 2 commits?”
  1. bill lamJan 13, 2009
  2. Jeff WhitesideJan 13, 2009
  3. Boyd Stephen Smith Jr.Jan 13, 2009
  4. Imran M YousufJan 13, 2009
  5. bill lamJan 13, 2009
  6. Stephen R. van den BergJan 13, 2009
  7. Sitaram ChamartyJan 13, 2009
  8. Matthieu MoyJan 13, 2009
  9. Sitaram ChamartyJan 13, 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.