About a week ago I started working on the open source project Filerjs.
This has been my first experience with working with the collaboration features in git and GitHub. I learned allot about the full process of using git and GitHub to help develop a opensource project.
The first thing I had to do is get a copy of the code. Below is the steps I followed to get setup.
- Fork the Original repository
- Cloned my fork to my local machine using “git clone “
- I created a upstream to the original repository “git remote add upstream “
- For this project I needed to do “npm install” in order to get the required modules for it to run.
- Now I was up and running and i could run existing test with “npm test”
I started my process for finding a bug with learning how to use filer. This, was also how I stumbled across the issue I fixed. I was looking into how I can use the fs.read() function, in order to see if I could add a test for it. Since, tests are small little programs that test a single piece of code, they are great to work on when joining a open source project. But, I didn’t end up getting that far before finding my first issue.
Well reviewing the doc’s for filer fs.read() I noticed that a variable name was incorrect in the example code in a few spots, below is the problem code.
So, Now that I have found an issue I submitted an issue for the problem. In the filer GitHub I created an issue, here is the link to my issue.
At the time I did not know that I could fix the doc’s but later learned that I was able to fix doc’s as well as code.
After being assigned the issue, below are the steps I followed to fix my issue and create a Pull Request.
- Create a new branch for your Issue “git checkout -b issue-###”
- Fix the issue. To do this I located the doc’s, which were in the README.md file. I found the problem lines and fixed them.
- I used “git status” to see the files I wanted to commit.
- I used “git add <filename>” to queue the files for the commit.
- You can view all the files that are going to be committed with “git log”
- Use “git push origin <branchName> ” to push the changes to your fork on GitHub
- Now using GitHub I created a pull request from my fork. Here is my Pull Request
My pull request was a small doc change so the admin’s quickly were able to merge it with the main project. The time it takes for a pull request to be merged is dependent on how complex the changes are. Since, my pull request was a small change it has been merged and you can see here the docs are now fixed.
Over the past week I also help another person with his pull request. There wasn’t any thing wrong with his code, I just helped him properly submit a pull request. He had accidentally included a couple of changes in other files, so I helped him by telling him about the git add <filename> command. Which allows you to choose individual files to add to your commit.