Re: how to apply patch in the middle

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

 



bill lam <cbill.lam@xxxxxxxxx> wrote:
> I want to change history to rewrite
> 
>   - A - B - C - D - E - ..
>  
> as
> 
>  - A - C' - D - E - ..

Uh, "git rebase -i A", change "pick" on line "C" to "squash".
This should have the same impact as what you are trying.

> because rebase/squash cannot automatically resolve conflicts, I
> generate a patch file from A to C
> 
>   git diff A C >pat
> 
> However I don't know how apply this patch and cancel the old B and C.

One way you can insert this is:

  git rebase -i A^
  change "pick" on line "A" to "edit"
  delete lines "B" and "C".

  when it stops for amend, don't amend.
  git apply --index pat
  git commit -m "my new B and C"
  git rebase --continue

-- 
Shawn.
--
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]

  Powered by Linux