Edgar.A Edgar.A - 1 year ago 123
Git Question

Github rebase fork's local branch on remote origin branch

I'm quite new to contributing to OS and after submitting pull request, author asked me to rebase my local branch on top of origin's master (I created my local branch from wrong branch). However I'm not really sure how I do it. From my local branch I try using 'git rebase origin/master' but it says my curren local branch is already up to date.

Answer Source

You first need to make sure your local repo is up-to-date with the upstream repo, by following these instructions.

Now that your master branch is up-to-date with the upstream's master branch, you can checkout to your local branch and rebase:

git checkout my-local-branch
git rebase master

Once the rebase is done, push your new local branch to github (you'll have to force the push):

git push origin my-local-branch --force-with-lease

The pull request will detect the change automatically.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download