Open source contributions are a great way to improve your skills, support your peers, and become part of a vibrant community. A common misconception is that contributions are limited to code, but there are other ways to contribute including documentation and testing. In this session you will find some simple issues in an open source project that need help, check out the project, make the change, and submit a pull request. To save time, please sign up for a GitHub account if you don’t already have one. If you haven’t worked with Git before, the preceding session is highly recommended.
2. Agenda
- What is a Pull Request (PR)?
- Finding open source projects that need help
- Forking & branching
- Commit your changes
- Submit your PR
3. What is a Pull Request (PR)?
- Propose and collaborate on changes to a project.
- Ideally scoped to a single issue with discrete changes and
clear commit messages to streamline review.
- Pull requests are generally reviewed and merged by a
contributor with commit access to the Git repository.
- You can submit a PR without having write access to the
original Git repository.
4. Finding open source projects that need help
- Improve open code, documentation, or testing for tools you
are already using.
- Most projects will have a README and Contributor Guide.
- Look for issues labelled ‘needs help` or `help wanted`.
- If you have a feature suggestion, raise a GitHub issue
before starting to work on it.
- If you’re looking for experience, try searching by
language and labels: http://github-help-wanted.com
5. Documentation is a great starting point
- Let’s look at:
https://github.com/IanWhalen/mongodb-tools.com
7. Clone your fork locally to begin development
- Fork the repo to your own account on GitHub
- git clone https://github.com/stennie/mongodb-tools.com.git
- Add the original repo as an upstream source to make it
easy to pull in future changes:
git remote add upstream
https://github.com:IanWhalen/mongodb-tools.com.git
- Check your sources: git remote -v
9. Create a feature branch to work on your changes
- Feature branches are conventionally named after the
related issue:
- git checkout -b issue-123
- You can switch between branches using git checkout:
- git checkout master
- git checkout issue-123
10. Commit your changes
- Make your changes
- Test appropriately (run test suite, preview documentation,
…).
- git commit
- git push
11. Submit the pull request
- GitHub has a handy UI for this.
- Include a description of what you changed and what you
tested.
- Be patient. It may take a while for maintainers to provide
feedback or review a change. Many open source projects are
driven by a small set of volunteers.
12. Resources
- help.github.com/en/articles/creating-a-pull-request
- Pro Git Book (free): https://git-scm.com/book/
- GitHub.com (free tier): Unlimited public repositories,
unlimited private repositories (up to 3 collaborators).
- Bitbucket.org (free tier): Unlimited public repositories,
unlimited private repositories (up to 5 collaborator).