0

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.

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for recommending --force-with-lease. Had never seen that until now. +1
1

You have to do a git fetch origin so that the changes in origin are available in your local machine, but not yet applied. Then do a git rebase origin/master which applies the commits in origin below your commit.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.