You are viewing an older revision! See the latest version

Collaboration/Pull requests

« Collaboration

Notice

This article covers features that are exclusively available on restricted beta of the mbed Online Tools. If you are interested in beta testing, contact an mbed staff member via private message or contact us via email at support@mbed.org to grant you access.

A pull request lets you tell others about changes you've added to a fork of their (or ancestor) repository, effectively granting them permission to include and use your code in their code base. Once the pull request is created, the other party can review, accept or reject the set of changes, discuss further modifications and even add follow-up changes or merges.

Think of pull requests as for simplified fork and update workflow, where the changes contributed by non-repository developers are being moderated by the repository author(s).

Day to day usage

An important thing to know about pull requests is that they can only exist between related repositories. The term 'related repositories' means that either repository is ancestor or sibling to the other through direct or indirect relationship (e.g. fork of the fork of the fork). Pull requests usually originate from a fork repository to ancestor repository, though the functionality is flexible and allows sending pull requests from ancestor repository to a fork for cases where the original author wants to contribute later added code to that fork.

Creating a pull request

When you publish a fork of someone else's repository, the mbed Developer site will recognize it as fork of the original repository and display it under repository details:

Click to enlarge

An additional "Create Pull Request" button will be displayed on top that is only visible to you and other repository authors (if any).

Click it and you'll be taken to the "Create Pull Request" page, where the URL fields for your and ancestor repository will be prefilled like shown below:

Click to enlarge

You can change the remote repository URL if you want to send a pull request to another related repository. The form will validate the repository URL addresses as you type or paste, and it will warn if either of them is wrong, missing or unrelated. Also it will check whether the forked repository (on left) has changes that aren't present in the destination repository (on right).

Add a suitable title and description that summarize the set of changes they should expect against their repository and specify any additional information they might find useful. It is also a good place to describe any licensing matter. As always, being polite goes a long way and they might even add you as author to their repository!

Click the "Send Pull Request" button when ready and it will be added as a new pull request in the "Pull Request" sub-page of their repository and also an email notification will be sent to them with the title and description you specified.

Click to enlarge

Notice

Pull requests are limited to the latest revision at the moment of sending. This means that you can publish more changes to your repository and the other party will only see the changes that were available when the pull request was created. To update your pull request to the latest revision, click the "Edit" button on the pull request page and check "Update request to latest revision(s)?" checkbox before you finish editing it. The other party will be notified that you edited the pull request.

Reviewing a pull request

This article is unfinished. We are working on it!


All wikipages