Like Autocracy , git rebase is probably what you want.
Example:
Say you have A-B-C-Dand you want to combine A-B-Cin Y. Creates a clone Cand reloads the clone to Y:
git checkout -b C_copy C
git rebase --onto Y A~1 C_copy
Check to see if everything went well and resolved conflicts in your way, if necessary.
C_copy Y, : Y-[A_copy]-[B-copy]-C_copy
rebase, . ( C_copy):
git rebase -i HEAD~3
- , C_copy, C.
Y C_copy git merge --no-ff ( --no-commit, , ):
git checkout Y
git merge --no-ff [--no-commit] C_copy