- Crea un branch temporaneo da
base-commit:
git checkout -b tmp-branch base-commit- Rebase interattivo del branch che contiene il commit:
git checkout branch-sorgente
git rebase -i base-commit-
- Nell’editor:
- Metti solo il commit che ti interessa come
pick dropgli altri
- Metti solo il commit che ti interessa come
- Nell’editor:
-
Ora
tmp-branchha solo il commit originale. -
Vai nel nuovo branch e fai il merge:
git checkout nuovo-branch
git merge tmp-branch