Getting Started with Open-Source

Getting Started with Open-Source

Introduction

Recently, someone sent me a DM on Twitter with the following:

I helped him as a response, but I really felt that there would be a lot of people just like him who don’t know what open-source is or how to contribute to open-source projects, so I made the decision to write this blog.

In this blog, we will explore the world of open source contribution and learn how you can get involved and make a difference. Whether you are a seasoned programmer or a newcomer to the world of open source, there are many ways you can contribute and make a positive impact on the projects you care about. So join us as we delve into the world of open source contribution and discover the many ways you can get involved!

1. What is open-source contribution?

Open-source contribution refers to the act of contributing to open source software projects. Open source software is software that is freely available for anyone to use, modify, and distribute.

Open-source software has become an increasingly important part of the modern tech landscape, powering everything from operating systems and web browsers to productivity tools and programming languages.

But open source software is not just about using and benefiting from the work of others – it is also about giving back and contributing to the community.

2. Why contribute? Advantages of contribution

There are many reasons why people choose to contribute to open-source projects. Some of the benefits of open-source contribution include:

  1. Learning new skills: Contributing to open-source projects is a great way to learn new skills and technologies, as you will have the opportunity to work on a wide variety of tasks and projects.

  2. Collaborating with others: Open source projects bring together people from all over the world who share a common goal. Contributing to open source allows you to collaborate with and learn from other talented individuals.

  3. Giving back to the community: Open source software is built and maintained by volunteers who donate their time and skills to the project. By contributing to open source, you can give back to the community and help make a positive impact.

  4. Building your portfolio: Contributing to open-source projects is a great way to build your portfolio and showcase your skills to potential employers or clients.

  5. Improving the software: Open source projects rely on the contributions of many people to improve and evolve. By contributing to open source, you can help make the software better and more widely used.

Overall, contributing to open source is a rewarding and fulfilling experience that allows you to learn, collaborate, and make a difference.

The prime motivation to contribute to open-source is to make the GitHub contribution graph look like this 😂

3. Steps to contribute the open-source projects

First, you have to look for an open-source repository you wish to contribute. I will be discussing how to find such repositories in detail in the next section. Once you have found a repository that looks interesting, you should read its description to get a better understanding of what it does and how it is used. You should also check the repository's "README" file, which usually contains more detailed information about the project. Suppose you want to contribute to the following repository :

There are some steps which you need to follow to contribute to any repo and those are as follows :

1. Make an issue / Work on an existing issue

Making an issue is an important way to help improve open-source projects and make them more useful for users. By reporting problems and suggesting new features, you can help the project maintainers prioritize their work and make the project better.

To make an issue on an open-source project, you will need to follow these steps:

  1. Look for the "Issues" tab: Most repositories have a tab called "Issues" where users can report problems or request features.

  2. Check if the issue has already been reported: Before creating a new issue, it is a good idea to search the existing issues to see if someone has already reported the same problem or requested the same feature. If the issue has already been reported, you can add your comments or vote for the issue to show your support.

  3. Create a new issue: If you cannot find an existing issue that matches your problem or request, you can create a new issue. To do this, click the "New Issue" button and fill out the form with a clear and concise description of the problem or request. Be sure to include any relevant details, such as error messages, steps to reproduce the problem, or screenshots.

  4. Submit the issue: Once you have completed the form, click the "Submit new issue" button to create the issue. The project maintainers will review the issue and may provide feedback or ask for additional information.

Here is an example of an issue that I created in the DoctorVerse repository.

Once the issue has been assigned to you then you can start working on the problem. Before you start working on the issue, you have to fork🍴 it.

2. Fork the repository

When you fork a repository, you create a copy of the repository on your account. This allows you to make changes to the repository without affecting the original repository.

To fork the repo you have to click on the top ‘Fork’ button and then click ‘Create Fork’. The forked repo will look like this :

You will see your-username/project-name on the top and below it, you will see ‘forked from…’.

3. Cloning the repository

Once you forked the repo then you have to clone it to start working on the problem. You can clone either using the GitHub desktop application or Git version control. In this blog, I will be using Git.

So, you have to make sure that Git is installed in your system. If it is not, then you can refer to this article - https://git-scm.com/downloads

To check whether Git is installed or not in your system, open Command Prompt

If it shows an error or commands not found then that means Git is not installed and you have to install it.

git —version

Once it is installed, run these commands -

  1. Clone your forked copy of the project into your local system

git clone --depth 1https://github.com/your-username/project-name.git

  1. Navigate to the project directory

cd project-name

  1. Add a reference (remote) to the original repository

git remote add upstreamhttps://github.com/project-name/project

  1. Check the remotes for this repository

git remote -v

  1. Always take a pull from the upstream repository to your master branch to keep it at par with the main project (updated repository)

git pull upstream main

  1. Create a new branch

git checkout -b yourBranchName

  1. Search the project folder and do the required changes.

  2. Track your changes. ✔️

git add .

  1. Commit your changes.

git commit -m "commit message”

  1. Push the committed changes in your feature branch to your remote repository

git push -u origin yourBranchName

4. Making a Pull Request

A pull request is a request to merge your changes into an upstream repository. When you make a pull request, you are asking the maintainers of the upstream repository to review your changes and consider incorporating them into the main branch of the repository.

There are several reasons why you might want to make a pull request:

  1. To contribute to an open source project: If you want to contribute to an open source project, you will typically need to make a pull request. This is the way that you can submit your changes to the project maintainers for review and consideration.

  2. To request feedback on your changes: Making a pull request is a good way to get feedback on your changes from the maintainers of the upstream repository. They may provide suggestions for improvement or ask for additional information, which can help you make your changes more effective.

  3. To collaborate with others: Pull requests are a great way to collaborate with others on a project. You can use pull requests to propose changes, discuss ideas, and work together to improve the project.

  4. To keep your changes up to date: If you are working on a fork of a repository and the upstream repository has changed, you can use a pull request to merge the upstream changes into your fork. This will help you keep your fork up to date with the latest changes.

To create a pull request, click on compare and pull requests.

Please ensure you compare your feature branch to the desired branch of the repository you are supposed to make a PR to. The branch in which I made the changes was shaadBranch so it is comparing shaadBranch with the main branch of DoctorVerse i.e. the upstream repository.

After you click the "Compare and pull request" button, you will be taken to a form where you can create a pull request. A pull request is a request to merge your changes into an upstream repository.

To create a pull request, you will need to provide a description of your changes and explain why you are requesting to merge them into the upstream repository. You should be clear and concise in your description and include any relevant details, such as the issue number or the reason for the change.

Once you have completed the form, you can click the "Create pull request" button to submit your pull request. The maintainers of the upstream repository will review your changes and may provide feedback or ask for additional information.

After you have submitted your pull request, you must wait for your PR to be merged. To review the PR, ping the Project Moderator or Project Admin on Discord or any other social media. They will surely review it, and if there are no corrections, they will finally merge it.

You should monitor the pull request for updates and respond to any feedback or requests for changes promptly. If your pull request is accepted, your changes will be merged into the upstream repository. If it is not accepted, you may need to make additional changes or revise your pull request.

Here is the snapshot of the PR that I made in the DoctorVerse repo :

Hurrah! Our PR is merged.

4. Finding a project to contribute to

To search for an open-source repository to contribute to, you can follow these steps:

  1. Use the search bar: You can use the search bar at the top of the page to search for repositories by keywords. For example, you can search for repositories related to a specific programming language, framework, or domain.

  2. Filter your search results: You can use the filters on the left side of the page to narrow down your search results. For example, you can filter by the programming language used in the repository, the number of stars or forks it has, or the date it was last updated.

  3. Read the repository's description: Once you have found a repository that looks interesting, you should read its description to get a better understanding of what it does and how it is used. You should also check the repository's "README" file, which usually contains more detailed information about the project.

  4. Look for open issues: Most repositories have an "Issues" tab where users can report problems or request features. You can look for open issues that you might be able to help with, or you can create a new issue if you have found a problem or have a suggestion for a new feature.

By following these steps, you should be able to find an open-source repository to that you can contribute. Remember to look for projects that align with your interests and skills, and don't be afraid to ask for help if you need it.

You can also use one of the following resources to help you discover and contribute to new projects:

5. Ways to contribute

There are many ways to contribute to open-source projects, and you don't necessarily need to be a developer to get involved. Here are some examples of ways to contribute:

  1. Write code: One of the most obvious ways to contribute to open source is to write code. This could be in the form of bug fixes, new features, or refactoring existing code to make it more efficient.

  2. Write documentation: Many open source projects need help with documentation, whether it's writing user guides, API references, or tutorials. If you have strong writing skills, you can contribute by creating or improving documentation for a project.

  3. Test the software: Testing is an important part of any software development process, and open-source projects are no exception. You can contribute to an open-source project by testing the software and reporting any issues you find.

  4. Provide user support: Open source projects often have active communities of users who help each other out. You can contribute to an open-source project by answering questions on forums or chat channels, or by helping other users troubleshoot problems.

  5. Design graphics: If you have design skills, you can contribute to an open-source project by creating graphics for the project's website, marketing materials, or documentation.

  6. Promote the project: You can help an open-source project by spreading the word about it and promoting it to others. This could involve writing blog posts, giving presentations, or creating social media content.

  7. Help with project management: Many open-source projects need help with tasks like planning, organizing, and coordinating the work of contributors. If you have project management skills, you can contribute by helping to keep the project running smoothly.

Overall, there are many ways to contribute to open-source projects, and you don't need to be an expert to get involved. By finding a way to contribute that aligns with your interests and skills, you can make a valuable contribution to an open-source project and learn new things along the way.

Summary

Open source contribution is a rewarding and fulfilling experience that allows you to learn, collaborate, and make a difference. Whether you are a developer, a writer, a designer, or simply someone who wants to help out, there is a place for you in the open-source community.

If you are new to open source contribution, it can seem intimidating at first. However, there are many resources available to help you get started, such as documentation, tutorials, and forums. Don't be afraid to ask for help or advice, and remember that everyone has to start somewhere.

To get started with open source contribution, you can search for projects that align with your interests and skills, and look for open issues or tasks that you can help with. You can also consider joining an open-source community or group to connect with other contributors and learn from their experiences.

By contributing to open source, you can make a positive impact on the world and help shape the future of software. So why wait? Find an open-source project that you are passionate about, and start making a difference today.