I have used the open source enterprise search platform Solr for a number of years now and on a recent project have been using the open source SolrNet .NET client library. The SolrNet library lacked a feature I required when used with the bundled Service Locator implementation. A number of people had been asking for the same feature so I decided to jump in and implement it.
This is the final part of my journey into learning Git, using GitHub and contributing to an open source project.
- Part 1 – Install Git
- Part 2 – Set up GitHub
- Part 3 – Fork project
- Part 4 – Contribute code
- Part 5 – Submit pull request
As I discussed in an earlier post, the typical workflow of contributors to an open source project hosted on GitHub can be a bit intimidating. It involves the following steps:
- Write and commit code
- Submit pull request
I have gone through forking a project and cloning the repository. Writing and committing code to your local repository. Pushing those changes up to your cloned repository on GitHub. Now all that is left is to submit a pull request to the master project.
I navigated to my paulbouwer/SolrNet repository on GitHub and after confirming the commit details via the Commits tab clicked on the Pull Request button.
I wrote a comment around the commits I was submitting in the pull request. GitHub always makes it clear as to what is going on. Note the You’re asking mausch to pull 1 commit into mausch/master from paulbouwer/master.
GitHub allows you to verify the commits included in the pull request via the Commits tab.
GitHub allows you to verify the files and diffs on those files included in the pull request via the Files Changed tab. I had a number of issues with line ending differences on my files vs the master project – so a great tip is to pay attention to these. Mauricio kindly resolved these for me.
GitHub allows you to preview your pull request message via the Preview submenu on the Preview Discussion tab. I finally submitted the pull request by clicking on the Send pull request button.
The pull request has now been added to the pull requests queue of the master project mausch/SolrNet. GitHub again makes it clear as to what is going on. Note the paulbouwer wants someone to pull 1 commit into mausch/master from paulbouwer/master.
Clicking on the Pull Requests tab in the master project mausch/SolrNet shows the current pull request queue and confirms that my pull request is in it.
I was notified by GitHub via email that my commit had been accepted by into the master project mausch/SolrNet. I confirmed this by clicking on the Commits tab on the master project page.
I also confirmed that the feature I had worked on was now closed in the SolrNet issues list. It felt good – my commit had been accepted into the master SolrNet project.
End of a journey
This has been an incredible journey and I can highly recommend dedicating some time and code to an open source project. The satisfaction of contributing to a project used by a community is something else. You also get a lot back – my knowledge of Git has improved and the insight into how other people code and their thought and design processes has been invaluable.
There’s nothing stopping you – find a project that you believe in and help out !