This weekend I contributed to my first (of many more!) open source projects. I pair-programmed with Cameron Cundiff on Whiteboard, a tool from Pivotal Labs that aims to increase the effectiveness of office-wide standups and increase communication with the technical community. Cameron is a great human being, painter and advocate for web accessibility. I am big fan of his work. This experience taught me many lessons. I wanted to write a few blog posts about what I learned. In this first one, I’d like to share how one goes about contributing and properly submitting a pull request to an open source project.
This is how the process works from start to finish.
0 – Find a project you want to contribute. Check what issues are open. These are features or software bugs that need to be worked on.
Cameron and I decided to work on issue #62, which required adding a link to the Whiteboard application landing page where the user can click on to show all standups locations.
2 – Clone your fork to your local machine
Simply go to the directory you want to clone and run this command in your terminal:
git clone https_address_of_your_repo
This creates a local folder in your directory. Cd into that folder and…
3 – Create a new branch
It is best practice to checkout a new branch when working on a feature or bug for an open source project. When you submit your pull request it is this branch that you send to the project’s owner.
Cameron and I did this by typing in our terminal
git checkout -b link-to-all-standups
After creating the branch, we coded and made the changes we wanted to contribute to the Whiteboard project.
4 – Submit the pull request
Add all the changes, commit, rebase if needed and push them to your remote repo.
Make sure you have the right repo selected. If not hit edit.
Be descriptive in your pull request and inform in detail what you did or if there is any information that is useful for others contributors to know. Also don’t forget to add the issue number that you addressed.
This is how we wrote in our pull request submission. Use this as a reference if you need.
I would love to hear from your future open source contributions. Keep me posted.