Created
April 21, 2015 20:12
-
-
Save ebridges/96ff29bf8a106da15fac to your computer and use it in GitHub Desktop.
How to rebase master onto a long-lived branch that has been pushed to origin already
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
## 0. | |
$ BRANCH_NAME=eqb/my-branch | |
## 1. Pull down latest remote version of master & branch | |
$ git checkout master && git pull | |
$ git checkout $BRANCH_NAME && git pull | |
## 2. Delete remote branch | |
$ git push origin --delete $BRANCH_NAME | |
## 3. Remove dangling reference to origin | |
$ git branch --unset-upstream | |
## 4. Apply changes from master on branch | |
$ git rebase master | |
## 5. (optional) Push branch back to origin | |
$ git push origin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment