This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |