Last active
October 18, 2017 14:30
-
-
Save msojka/737c652bc938e76b763d8800070f43bd to your computer and use it in GitHub Desktop.
This file contains 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 | |
git checkout -b branch-B | |
git push -f -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment