To ask for a change you’ve made in your own Raspberry IO repository to be merged into the official repository, you make a pull request. If you’re already familiar with Github and pull requests, just open a pull request against the develop branch of the Raspberry IO repository. (https://github.com/python/raspberryio/tree/develop) Be sure that your code passes all tests, conforms to our code standards, and has appropriate documentation.
Read the rest of this document for more details.
Work on a branch from the develop branch. Raspberry IO uses the Git Flow system to manage branches and releases. If you’re using the gitflow tool, you can start your branch with:
$ git flow feature start NAME
Switched to a new branch 'feature/NAME'
Summary of actions:
- A new branch 'feature/NAME' was created, based on 'develop'
- You are now on branch 'feature/NAME'
Now, start committing on your feature. When done, use:
git flow feature finish NAME
$
If you’re not using the gitflow tool, create a new branch from develop and switch to it:
$ git branch feature/NAME develop
$ git checkout feature/NAME
Switched to branch 'feature/NAME'
$
Login to your Github account, then go to the Raspberry IO repository on Github and create a fork by clicking the Fork button near the top right of the page.
We’ll assume you already have a local clone of the repository that you’ve been working in, so all you need to do is add a new remote definition pointing to your new fork. You might choose to name your new remote definition using your Github username, to keep it distinguished from the remote pointing at the official repository.
$ git remote add username git@github.com:username/raspberryio.git
$ git remote -v
username git@github.com:username/raspberryio.git (fetch)
username git@github.com:username/raspberryio.git (push)
origin git://github.com/raspberryio/raspberryio.git (fetch)
origin git://github.com/raspberryio/raspberryio.git (push)
$
Your change needs to be on Github before you can open a pull request against the Raspberry IO code. Unless you have Raspberry IO commit privileges, you’ll need to upload your change to your own fork of the repository.
Assuming your branch name is feature/NAME:
$ git push -u username feature/NAME
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:username/raspberryio.git
* [new branch] feature/NAME -> feature/NAME
Branch feature/NAME set up to track remote branch feature/NAME from username.
$
Go to your fork of the Raspberryio repository on the Github web site (https://github.com/username/raspberryio/).
Click the Pull request button near the top center of the page.
Check the settings:
Enter an informative name and description for your pull request. By default, Github will try to pull these from your commit messages, but often you can improve them.
Your pull request description is your chance to convince people that your change is worthwhile and will benefit Raspberry IO. Here are some things to consider addressing:
Switch to the Files Changed tab and check that the changes shown are what you expect. If not, go back and check that you’ve committed the changes you intended on your branch, that you pushed it to your repo, and that the pull request settings are correct for your repo and branch.
When everything looks right, switch back to the New Pull Request tab and click the green Send pull request button in the lower right, below the description box.