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

Re: How to reorder all commits include the initial commit

From
Yi, EungJun <semtlenori@gmail.com>
Date
Mar 17, 2012, 19:45 UTC
Message-ID
<CAFT+Tg9UGdBxj5-DTpxDJRVgvBCnmkmgm6nzVek0KeELgsNneQ@mail.gmail.com>
In-Reply-To
<m3k42jl2wn.fsf@localhost.localdomain>

Thanks to David Barr and Jakub Narebski. Finally I found the way based on your hints to solve my problem.

$ git checkout -b test --orphan $ git format-patch <newroot>^..<newroot> | git am $ git rebase -i --onto test --root master $ git branch -M test master

Please let me know if there is more simple way.
2012년 3월 17일 오후 11:26, Jakub Narebski <jnareb@gmail.com>님의 말:
Show 18 quoted lines
> semtlenori@gmail.com writes:
>
>> Sometimes, I need to reorder all commits, which include the initial
>> commit, in my branch.
>> So I tried it using git-rebase as follows, but it failed with the fatal error.
>>
>> (supposing the initial commit is 793ea88)
>> $ git rebase -i 793ea88^
>> fatal: Needed a single revision
>> invalid upstream 793ea88^
>>
>> How can I do that?
>
> Use `--root` option.
>
> --
> Jakub Narebski
>
Previous: Jakub NarebskiNext: Jiang Xin
Message 4 of 6 in “How to reorder all commits include the initial commit”
  1. 이응준Mar 17, 2012
  2. David BarrMar 17, 2012
  3. Jakub NarebskiMar 17, 2012
  4. Yi, EungJunMar 17, 2012
  5. Jiang XinMar 18, 2012
  6. Yi, EungJunMar 18, 2012

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.