Re: How to reorder all commits include the initial commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/3/18 Yi, EungJun <semtlenori@xxxxxxxxx>:
> 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

option -b and --orphan can not be used together.

> $ git format-patch <newroot>^..<newroot> | git am

can not apply patch when there is no root commit

My test for your case:

log of master branch before rebase:

    $ git log --oneline
    1a91ece commit 3
    d7c6dec commit 2
    e32542d commit 1

rebase:

    $ git checkout --orphan new-master
    $ rm .git/index
    $ git commit --allow-empty -m initial
    $ git clean -fd
    $ git cherry-pick -n master^
    $ git commit --amend -C master^
    $ git rebase --root --onto new-master master
    $ git branch -d new-master

master after rebase:

    $ git log --oneline
    fbb9fb6 commit 3
    56afd5c commit 1
    894c42a commit 2

--
Jiang Xin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]