Skip to content

Instantly share code, notes, and snippets.

Rebasing branch-B onto branch-A when history of branch-A changed
git fetch
git checkout branch-B
- has to be up-to-date
git checkout -b backup/branch-B
git checkout branch-B
git rebase --onto {SHA of destination commit in branch-A} {predecessor SHA of where to start from in branch-B - most often same commit as the one in the first argument just different SHA now} {most often SHA of last branch-B commit}
- see http://weblog.avp-ptr.de/20120928/git-how-to-copy-a-range-of-commits-from-one-branch-to-another/
git branch -D branch-B