-
Notifications
You must be signed in to change notification settings - Fork 29
how to rebase your code
If you submitted a pull request, but have been asked to 'rebase your code' then this is what you need to do.
We will refer to the plainblack/Lacuna-Server-Open repository as pb-ls-open
It is likely you will have a github repository (which we will call xx-ls-open) and a local clone of it.
The repositories will currently look something like this.
A---B---D pb-ls-open/develop
\
C xx-ls-open/develop
What has happened is that you have checked out a copy from pb-ls-open when commit B was at the HEAD. You made your change C but in the mean-time someone else submitted change D on the open source repository.
In your local clone do the following.
$ git checkout develop
$ git pull --ff-only xx-ls-open develop (probably not necessary)
$ git pull --rebase pb-ls-open develop (note 4)
(note 4) git recognises that this is doing a rebase of your change but it does not affect your local develop branch. Instead it throws you out onto a (no-branch) branch.
Your local repository should now look like the following.
A---B---C develop
\
D---C' (no-branch)
What you need to do is to delete both your local develop branch, and it's partner on your github account, then rename your (no-branch) as the new develop
$ git branch -d develop (this deletes the local develop branch)
$ git push xx-ls-open :develop (this deletes the remote develop branch)
$ git checkout -b develop (this creates a new local develop branch)
$ git push xx-ls-open develop (this creates a new remote develop branch)
Your repository should now look like
A---B---D---C' xx-ls-open/develop
When you now resubmit a pull request to pb-ls-open, (assuming no further updates to it) it should be possible to do a clean fast-forward merge.