, ,
git fetch theirs
,
A -- B -- C -- D -- E -- F -- G <--(master)
d -- H -- I -- J <--(theirs/master)
(TREE) d d.
H J master, d . , , , - , . .
, . - H J d. , / - , reparent H . ( d d , .)
H, git filter-branch --parent-filter. (SHA) d d, , , sed script, d d. . filter-branch; , .
, , , . , d - , master~3 , - , d - theirs/master~3 .
git checkout theirs/master
git checkout -b temp
git rebase --onto master~3 theirs/master~3
A
\
H'
d
temp master theirs/master; , H', I' J' - ( ID ..), , theirs , .
, theirs , :
theirs, . " " theirs/master temp temp master.
git checkout temp
git merge -s ours theirs/master
A
\
H'
/
d
JJ " " - / J' J. , , , .. , "/ " . .
, J, J' JJ , temp - master
A -- B -- C -- D --- E --- F --- G --- M <--(master)
\ /
H' -- I' -- J' -- JJ <--(temp)
/
d -- H -- I -- J <--(theirs/master)
temp.
d, H, I, J JJ, , theirs.
A -- B -- C -- D --- E --- F --- G --- M -- N -- O -- P <--(master)
\ /
H' -- I' -- J' -- JJ
/
d -- H -- I -- J -- K -- L <--(theirs/master)
theirs/master master, git , J .