First timers’ Practical Guide to Open Source Contribution
Tags: opensource, github, git
Published: 2023-02-20 09:43:00

The source code for open-source software or projects is made public, allowing anyone to understand how the program works. You can also modify it, by fixing the issue(s) or bug(s) you noticed, proposing new features, or even interacting with the developers or maintainers.

This overview highlights a thorough, easy-to-understand guide to making open-source contributions as a beginner. Let’s dive in!

## What is Open Source?

Open source implies that it is freely and publicly available for anyone to use, inspect, modify, or enhance.

As a first-timer, you might get confused about how to make your first open-source contribution. I'm sure you will find a way out after going through this article. Without further ado, let's get started!

![Open Source by ICTWorks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ak6seclp5fdvlquzv7ld.png)

## A general approach to open source contribution

* **Find open source projects on GitHub:** Search for open source projects built with your preferred programming language.
    
* **Pick an open issue:** Choose an issue with ***first-timer***, or ***beginner-friendly***. If you are interested in fixing the issue, add a comment stating you would be working on it.
    
* **Work on the issue:** Go through the *CONTRIBUTING.md* file to know how to contribute.
    
* **Submit your pull request**: Make sure you follow the conventions stated in the *CONTRIBUTING.md* file while submitting a pull request (PR). Add a good commit message too.
    
* **Wait for feedback:** The open source maintainer(s) will review the PR or suggest changes if there’s a need before it’s merged.
    

## Practical steps to take before making any open source contribution

* Find a project you would like to contribute to.
    
* Go through the *README* file.
    
* Read the *Code of Conduct.*
    
* Read the *Contributing Guideline.*
    
* Read the *Development and setup instructions.*
    
* Indicate you are will work on an issue by commenting.
    
* Fork and clone the project into your computer locally.
    
* Submit a Pull Request.
    
* Wait for the Pull Request to be reviewed and/or merged.
    

## A step-by-step guide to open-source contribution

There are two basic ways of contributing to open source;

**a. Create your project publicly:** This involves starting your project and hosting it on GitHub.

**b. Contribute to existing open-source projects**

Before participating in open source, you should understand the project, its codebase, and the use of [Git](https://git-scm.com/) and [Markdown](https://www.markdownguide.org/). Check out Learn Git [Branching](https://learngitbranching.js.org/) for an interactive lesson on Git.

Let's look at the guidelines for downloading the project locally, making changes, and then publishing them online for review:

### **1\. Fork the repository**

By forking a repository, you have a copy of the project. Now, you can edit and submit your own updated copy through a pull request, to be included in the main project.

![fork a repository](https://cdn.hashnode.com/res/hashnode/image/upload/v1671360434254/EDXIKYdbY.png?auto=compress,format&format=webp align="center")

### 2\. Clone the repository

Once, the repository is forked on your own GitHub profile, the next step is to download it to your computer. To clone a repository, copy the HTTPS or SSH URL

![Clone GitHub repository](https://cdn.hashnode.com/res/hashnode/image/upload/v1673775587779/2a1ac0ec-4c8a-45fd-92b6-7c3546820e1f.png?auto=compress,format&format=webp align="center")

In your GitBash or terminal, run the command, which should look like this:

```bash
git clone https://github.com/<your-username>/project-name.git
```

**Note:** Install [Git](https://git-scm.com/downloads) on your computer and connect your GitHub account to it, if you haven't already.

### 3\. Change to the repository directory

Navigate to the project folder using the command below:

```bash
cd project-name
```

### 4\. Synchronize and reference your local repository to the remote repository

Add the main project repository upstream to your already cloned local project files by running the following command on your terminal:

```bash
git remote add upstream https://github.com/<Project-owner>/project-name.git
```

Check if your cloned repository syncs with the remote repository.

```bash
git remote -v
```

You can easily pull any changes from the remote repository to your computer by entering the command:

```bash
git pull
```

### 5\. Create and switch to a new branch

Creating a new branch gives you room to make any changes, or experiment with the project without affecting the main branch.

```bash
git checkout -b branch-name
```

### 6\. Open the project folder in a Code Editor

Locate the repository folder on your computer, and open it or drag and drop it into your favorite code editor. Then, make the necessary changes, fix an issue, or add new features.

Confirm the state of the current branch and all modified files with the command:

```bash
git status
```

**Note:** Changed file names should appear in red while unchanged files appear in green.

### 7\. Stage all files to Git

Apply all changes and add all the files to the git tracking list. Enter the command in your terminal:

```bash
git add .
```

### 8\. Commit changes to Git

Now, you should commit all the changes to your branch. The command below commits the changes with a unique hash on Git:

```bash
git commit -m"describe the changes made"
```

**Note:** Writing a concise commit message in the active voice is recommended.

### 9\. Push the new branch to the remote repository

In this step, publish your branch and the file changes to GitHub. In your terminal, enter the command:

```bash
git push origin branch-name
```

### 10\. Submit a pull request for review

Go to the forked repository on GitHub, where you can see all of your file changes and a "**Compare and Pull Request**" button. Click it to open a pull request from your featured branch to the project repository's main branch.

Add the appropriate title and description to your pull request. Once, it is reviewed, your pull request will be merged by the project maintainer.

Congratulations! You just contributed to open source.

Do you want to gain first-hand experience? Check out the following GitHub repositories:

* [https://github.com/Syknapse/Contribute-To-This-Project](https://github.com/Syknapse/Contribute-To-This-Project)
    
* [https://github.com/Syknapse/first-contributions](https://github.com/Syknapse/first-contributions)
    

## No-code open-source contribution

A common misconception is that learning to code or becoming a developer is required before working with open source. Fortunately, most contributions are "code-free."

Let's look at some non-coding approaches to open source. Below are ways to contribute to Free and Open Source Software (FOSS) without knowledge of programming or code:

* Submit Bug reports by opening new issues.
    
* Ask questions by getting involved in the project discussions.
    
* Answer others' questions or provide feedback.
    
* Write a blog post about an open-source project or open-source in general.
    
* Become an advocate or evangelist of open source project(s).
    
* Write tests for FOSS projects.
    
* Help with design and UX research.
    
* Sponsor, donate, or provide any financial support for the open-source project you use.
    
* Improve the documentation of open-source projects on GitHub.
    

## Summary

Contributing to open source may seem quite daunting as a first-timer, but you will get familiar with the process through continuous practice. As a recap, there are many ways to make open-source contributions other than just code, such as by opening issues, updating the documentation, or suggesting new changes.

## References

* [The Definitive Guide to Contributing to Open Source](https://www.freecodecamp.org/news/the-definitive-guide-to-contributing-to-open-source-900d5f9f2282/)
    
* [How to contribute to an open-source project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-githu)
    
* [Contributing To Open Source Projects](https://academy.zerotomastery.io/courses/700470/lectures/12808415)