Mistake on this page?
Submit a change in GitHub or email us

Forking a repository

When you add changes to an imported repository in your private workspace, you may want to publish them for others to use.

Unless you are the author of the imported repository or have developer access, you will be forced to fork (or republish).

  1. Open the context menu of the imported program or library and click Publish:

    Making changes from your private workspace public

  2. You are prompted to publish to the linked remote repository:

    Publishing your changes to the remote repository

  3. As you do not have permission to publish to the repository, click the Fork... button:

    Forking and describing your forked repository

  4. Your repository, with all its changes, is published to your profile on the mbed.org website.

The forking process is identical to the code publishing workflow, with the exception that the forked repository will be recognized as a fork of the original or imported one:

Identifying a forked repository and its ancestor

Note: When you fork a repository, the local repository in your workspace is linked to the forked remote repository - the URL changes to the forked repository's URL. You can change the URL by clicking the pencil icon next to the URL in the Revisions panel.

Once the fork is complete, you can send a pull request, asking the ancestor (imported) repository to pull from your fork. This is covered in the Pull requests page.

Updating from a fork

If someone forks one of your repositories and modifies it, you can easily pull in any changes they have made into your own workspace.

  1. Click the Update From... button:

  2. Enter the URL of the published repository you want to pull changes from:

    Choosing the repository whose changes you want to pull

  3. Click OK. The changes are pulled into your local repository.

Note: This won't change the URL of your local repository.

Comparing with a fork

The Revisions panel lets you compare a local repository with a remote one, if they are "related". The term "related repositories" means that one repository is the ancestor of the other, through direct or indirect relationship (for example, a fork of the fork of the fork).

Comparing repositories doesn't apply any actions or changes to your local repository, so you can safely review the remote revisions without affecting your local work.

To compare the local repository with the remote one:

  1. Open the Revisions panel and click the "Compare With ..." button on the bottom panel:

    Comparing a local and a remote repository

  2. Enter the URL of the remote repository you want to compare with.

    Choosing the remote repository to compare

  3. Click OK. The repositories are compared, and the Revisions panel reflects the comparison mode:

    Viewing the comparison in the Revisions panel

You can view the remote changes by clicking on revisions in the bottom (remote) panel. You can then

  • Pull individual revisions through the Pull this revision context menu item, or by dragging and dropping them to the upper (local) panel.
  • Pull all changes using the Pull All button.
  • Pull and switch to the latest revision using the Update button as you would normally do in noncomparison mode.