Contribute to open source on GitHub

Mohomed Rikas
5 min readMar 5, 2021

Have you thought about contributing to an open source project, but you’re too confused by the process to even try? I’ve been there too!

I wrote this step-by-step guide to illustrate the exact method I use when contributing to a project on GitHub. If you follow this guide exactly,

you can make your first open source contribution TODAY!

Do you code? you can contribute by writing your code

Do you design? You can contribute by styling the project

Do you write ? you can improve the project documentation

Do you like organizing things ? You can contribute by organizing events, deadlines, and track progress on projects

Do you like helping people? you can contribute by answering their questions and guide them through

Steps to be followed

Step 1: Sign into GitHub

Sign into your GitHub account, or create a free GitHub account if you don’t have one.

Step 2: Fork the project repository

Find the project’s repository on GitHub,

and then “fork” it by clicking the Fork button in the upper right corner:

This creates a copy on your account.

n the upper left corner, you will see that you are now looking at a repository in your account:

Step 3: Clone your fork

While still in your repository, click the green Code button and then click to clipboard icon:

Using Git on your local machine, clone your fork using the URL you just copied:

git clone URL_OF_FORK

For example, I used

git clone https://github.com/RikasMRM/WeCarePlus.git.

Cloning copies the repository files (and commit history) from GitHub to your local machine. The repository will be downloaded into a sub-directory of your working directory, and the sub-directory will have the same name as the repository.

(If you run into problems during this step, read the Set up Git page from GitHub’s documentation.)

Step 4: Change to the repository directory

Since the clone was downloaded into a sub-directory of your working directory, you can navigate to it using: cd NAME_OF_REPOSITORY

For example, I used

cd WeCarePlus

Step 5: Create a new branch

Branching exists to help you manage the different ideas or features in progress. When you create a branch, you’re creating an environment where you can try new ideas without affecting the master branch. Therefore,experiment and commit changes, as these won’t be merged until they’re ready to be received by another collaborator.

git checkout -b BRANCH_NAME

to create a new branch and then immediately switch to it. The name of the branch should briefly describe what you are working on, and should not contain any spaces.

Use git branch to show your local branches. You should see your new branch as well as “master”, and your new branch should have an asterisk next to it to indicate that it’s “checked out” (meaning that you’re working in it).

Step 6: Make changes in your local repository

Use a text editor or IDE to make the changes you planned to the files in your local repository. Because you checked out a branch in the previous step, any edits you make will only affect that branch.

Step 7: Commit your changes

Whenever you add, edit or delete a file, you're making a commit and adding them to your branch . This process keeps track of your progress as you work on a feature branch.

Commits also create a transparent history of your work that others can follow to understand what you've done and why.

After you make a set of changes,

use git add -A

to stage your changes and

git commit -m “DESCRIPTION OF CHANGES”

to commit them.

If you are making multiple sets of changes, it’s a good practice to make a commit after each set.

Step 8: Push the changes to fork

When you are done making all of your changes, upload these changes to your fork using

git push origin BRANCH_NAME.

This “pushes” your changes to the “BRANCH_NAME” branch of the “origin” (which is your fork on GitHub).

Step 9: Create the pull request

What we are doing here is basically propose and collaborate on changes to a repository

1.navigate the main page of the repository

2. In the branch menu choose the branch that contains your commits.

3.To the right of the Branch menu, click New Pull Request

4.Use the base branch drop-down menu to select the branch you'd like to merge your changes into, the use the compare branch drop-down menu choose the topic branch you made your changes in

5. Type a title and description for your pull request and create pull request

Congrats you’ve just made your first contribution.

Hacktoberfest

Hacktoberfest is a celebration of open-source software that takes place every year during October. … You need to find open source projects on GitHub that you find interesting then look for bugs or changes that would benefit the project. Or, you can also help the team fix the existing known issues within their software.

References

https://www.dataschool.io/how-to-contribute-on-github/

--

--