Thank you for your reply.
I will try it.
在 2012年12月20日星期四UTC+8下午4时28分21秒，Thomas Ferris Nicolaisen写道：
> On Thursday, December 20, 2012 7:25:19 AM UTC+1, Wei Alex wrote:
>> I need to merge multiple special commits to one.Please help me.
>> For example, I have some commits like this：
>> Some of these were commited by me. I want to select them and merge
>> them to one commit just like A->C->E.The new commit A include the commit A
>> B and D.
>> Now I knew one method to merge multiple commits to one.
>> * git resest --soft HEAD^n*
>> * **git commit --amend*
>> BUT this method can just merge the TOP n commit not the special ones.
>> Please tell me how can I finish this work.Thanks.
> Rebase interactive is your friend:
> In essence:
> git rebase -i A
> # reorder the commits so that the ones you want to squash together are
> right after one another
> # squash up the commits
> Remember, if you have already shared or published this history you should
> NOT rewrite/rebase it any more.