Beginner's Guide To Making First Open Source Contribution. (2/2)

Beginner's Guide To Making First Open Source Contribution. (2/2)

·

3 min read

In my last post, we were able to make our first Open Source contribution using the GitHub desktop app but in this post, we will be making our contribution using the command line.

The command line, also called the Windows command line, command screen, or text interface is a user interface that's navigated by typing commands at prompts, instead of using a mouse.

As a developer, we need to be familiar with the command line as it makes our workflow easier. We would be using git bash which allows us to use git features in the command line. Git bash can be downloaded from git scm.

In this post, we would be contributing to contribute to Open source.

Fork the repo

First off we need to fork the repo we want to contribute to on GitHub. Open the repository contribute to Open source and click the fork button at the top right corner. After forking the repo, click on the code button then copy the git URL.

article1.png

article2.png

Clone the repo

To clone the repo, we have to navigate into the folder we will like to clone our fork repo into. To do this, open Git bash then type cd *preferred folder*/

e.g. cd documents/

Clone the repo by typing in git bash git clone *Git URL we copied from our fork repo*

Make changes to the repo

Open the cloned folder in your IDE and make changes to the repo while following guidelines in the README and save your changes.

Commit changes

To commit our changes, open Git bash and navigate into the cloned folder by typing cd *cloned folder name*

Then we add our changes to the staging area by typing git add *name of the file we made changes to*

e.g. git add calculator.js

git add calculator.test.js

Now we can commit our changes by typing in the terminal, git commit -m "commit message"

e.g. git commit -m "implement_check"

Push changes

To push our changes to our fork, in the terminal type git push origin master

Pull Request

In order to make our changes visible in the original code, we need to make a PR to the forked repo. Go to your forked repository in your browser, click on the Pull Request button, then click compare and pull, then click on the create pull request button.

article3.png

Screenshot (145).png

Screenshot (147).png

Hurray! We've been able to make another Open Source contribution, now we should be able to contribute to other Open Source projects without feeling intimidated.

Here are platforms that encourage Open Source contributions

You can also check my first post for more Open Source projects, here.

Article cover by Markus Winkler from Unsplash.