Skip to content

Instantly share code, notes, and snippets.

@toyowata
Last active August 7, 2020 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toyowata/24e523419ddbce31d2039386059acdbd to your computer and use it in GitHub Desktop.
Save toyowata/24e523419ddbce31d2039386059acdbd to your computer and use it in GitHub Desktop.
Rebase to master branch of mbed-os GitHub

References

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/merging-an-upstream-repository-into-your-fork
https://os.mbed.com/docs/mbed-os/v6.1/contributing/index.html

Clone your repo's master branch

$ git clone https://github.com/username/mbed-os
$ cd mbed-os

Create remote upstream repo (once per your local repo)

$ git remote add upstream git@github.com:armmbed/mbed-os.git

Sync to mbed-os master

$ git checkout master
$ git fetch upstream
$ git merge upstream/master
$ git push

Now, your master branch for both local and remote repo is up-to-date (same as ArmMbed/mbed-os master branch)

Rebase to master

$ git checkout master
$ git pull
$ git checkout your_dev_branch
$ git rebase master

# if you get conflict file, please fix it manually

$ git push -f

Now, your development branch is up-to-date and has your commits code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment