, , A--B--C--D, . Rebasing , diffs (changeets), , , , , , A, commit A' H, , B, commit B', A' ..
git filter-branch . :
git filter-branch <filter-list> <branch-name>
Git , <branch-name>, . , , , commit , <filter-list>, . Git , .. " ", .
commit ( , , , , , , , , , , , , ..) 100% -, , commit . " " . " " - , .
( , , , , , , - commit . , : < old-hash, new-hash > . - .)
, - , root commit. , --parent-filter. , --parent-filter. git filter-branch:
- <command>
git -commit-tree (1): , "-p parent" normal commit "-p parent1 -p parent2 -p parent3..." merge commit.
, , stdin , , -p <hash-of-H>. :
E--F--G--H--A'-B'-C'-D' <-- master
( , , , , ).
( E-F-G-H, master-old , -- , , E, , , timemstamp .)
. - --commit-filter: , . - , ; , , .
git replace
, git replace. , git replace , , , refs/replace/ -. , Git , Git , refs/replace/<hash-id>. , Git , .
, Git, commit A, . , commit -, . - commit H. ( , , A.)
, , A' - refs/replace/<big-ugly-hash>:
A--B--C--D <-- master
E--F--G--H <-- master-old
\
A' <-- refs/replace/deadcabf001...
( A , , , deadcabf001..., ID).
git log , commit D, commit D, D C, C, B ID B, A ... whoa, , refs/replace/ ! A ! A'! A' B parent, A' parent H, G ..
git replace, - . , "" " " - ", . Git :
- , , ;
- -,
refs/replace/hash ; - ,
git --no-replace-objects.
3 () , . 2 , git clone . ( , ).
- 2 , , , , git filter-branch. git --no-replace-objects filter-branch, Git commit A' commit A. A' A. --parent-filter. E H, -, , . , git filter-branch .