close icon
daily.dev platform

Discover more from daily.dev

Personalized news feed, dev communities and search, much better than what’s out there. Maybe ;)

Start reading - Free forever
Start reading - Free forever
Continue reading >

Contributing to Open Source GitHub: A Beginner's Guide

Contributing to Open Source GitHub: A Beginner's Guide
Author
Nimrod Kramer
Related tags on daily.dev
toc
Table of contents
arrow-down

🎯

Learn how to contribute to open source GitHub projects as a beginner. Discover how to set up a GitHub account, understand Git and GitHub, find projects, make contributions, and more.

Contributing to open source projects on GitHub can seem overwhelming for beginners, but it's a fantastic way to improve your coding skills, connect with the coding community, and contribute to projects you care about. This beginner's guide will walk you through the essentials:

  • Setting up a GitHub Account: Create a professional-looking account and enable security features.
  • Understanding Git and GitHub: Learn basic Git commands and how GitHub works for collaborative projects.
  • Finding Projects: Discover projects that match your interests and skills.
  • Making Contributions: Learn how to fork, clone, and make pull requests to contribute to a project.
  • Beyond Coding: Explore other ways to contribute, such as improving documentation or designing assets.
  • Building a Habit: Tips on making regular contributions to open source projects.

Whether you're fixing bugs, adding features, improving documentation, or even organizing community events, there's a way for everyone to contribute to open source GitHub projects. Let's dive in to make your first contribution!

GitHub Account

  • First off, if you don't already have a GitHub account, go create one for free at github.com. Pick a username that looks professional.

  • Fill out your profile with your real name, where you're from, where you work, and a picture of yourself. This makes you look more trustworthy to others in the open source world.

  • Turn on two-factor authentication to keep your account extra secure.

  • Make sure you've got your email preferences sorted so you know where GitHub notifications will be sent.

Understanding of Git and GitHub

  • Learn some basic git commands to help you manage versions of your work:
  • git clone lets you copy a project to your computer
  • git add gets your changes ready to be saved
  • git commit saves your changes with a note about what you did
  • git push sends your saved changes back to GitHub
  • git pull grabs the latest updates from GitHub
  • Understand that Git is the tool you use on your computer to track changes, and GitHub is the website where everyone sees and works on the project together.
  • Try out GitHub's quickstart guide to learn about projects (repos), talking about changes (issues), suggesting changes (pull requests), looking at changes (reviewing), and combining changes (merging).
  • If you prefer using a program with a graphical interface, consider downloading GitHub Desktop or Visual Studio Code. They make working with Git and GitHub easier because they visually show you what's happening.

Project Guidelines

Before you start helping out, make sure to read through a project's important documents:

  • The README gives you the big picture, how to set things up, and how to help out.
  • The CODE_OF_CONDUCT tells you how to be a good community member.
  • The CONTRIBUTING doc gives you the nitty-gritty on how to submit your help.
  • Check the Issues tab for things that need attention and the Pull requests tab to see what others have contributed.

This helps you get the lay of the land and ensures you're pitching in the right way.

With these basics in hand, you're all set to start contributing!

Understanding Open Source

Open source software lets anyone look at, change, and make the software better. It's built on the idea that sharing code and working together can make software that works well for everyone.

Here are some basics about open source:

  • See and Change the Code - Anyone can see the full code, use it, change it, and share it. This means more people can help make the software better.
  • Different Rules for Sharing - Open source has rules (called licenses) about how you can use, change, and share the software. Some well-known rules include MIT, GPL, and Apache.
  • It's All About Teamwork - Open source projects are made by people from all over the world working together. You can help out by fixing bugs, adding new features, writing guides, and more.
  • Safety Checks - Because the code is out in the open, experts can check it for problems. This means mistakes can be found and fixed faster.
  • Free to Use - You can download and use open source software without paying. This is great for people or groups that don't have a lot of money. Some big projects might offer paid support if you need extra help.
  • Used Everywhere - Open source software is behind a lot of the internet, like websites, apps, and even some phones and computers. It's used by lots of people and companies because it's flexible and free.

Helping out with open source projects can be a great way to get better at coding, meet other coders, and make software that's good for everyone. It's all about sharing and working together to build something great.

Setting Up Your GitHub Account

Let's get you started with a GitHub account. It's free and not too hard to set up. Here's how to make your account look good and professional:

Signing Up

  • Head over to github.com and hit Sign up at the top right.
  • Pick a username that looks professional. Using your real name or a mix of your first and last names is a good idea.
  • Enter your email and pick a strong password.
  • Check your email for a confirmation from GitHub and click the link to prove it's really you.

Profile Tips

  • Add a clear picture of yourself. It makes you more relatable.
  • Write a bit about who you are in your bio. Include your skills, what you like, where you live, and so on. This helps people trust you more.
  • Share links to your other profiles like LinkedIn or your blog to show off your work.
  • Make sure people can see your profile by keeping it public.

Security

  • Turn on two-factor authentication. This means you'll need a code from your phone to log in, which keeps your account safer.
  • Choose which emails from GitHub you want to get so your inbox isn't overwhelmed.

By setting up your profile to look professional and be complete, you're showing the open source community that you're serious about contributing. It's all about making a good first impression.

Getting the Hang of Git Basics

Git is a tool you'll use a lot when you're helping out with projects on GitHub. Let's go over some basic stuff you should know about Git:

Git Repositories

Think of a Git repository (or repo) as a big folder for your project. It keeps all your project's files and the history of changes. You can have these repos on your own computer or online on GitHub.

  • To grab a copy of a project from GitHub to work on, type git clone <repo URL> in your command line.
  • You now have your own local version of the project.

Git Branches

Branches are like parallel worlds for your project. They let you work on different stuff at the same time without messing up the main project.

  • The main branch is like the project's backbone.
  • To start working on something new, make a new branch with git branch <branch name>
  • Jump into your new branch with git checkout <branch name>
  • When you're done, you can bring your changes back to the main project.

Making Changes

Here's a simple way to think about making changes to a project:

  1. Start a new branch
  2. Change or add code and make sure it works
  3. Get your changes ready with git add <files>
  4. Save your changes with a note using git commit -m "<message>"
  5. Send your changes up to GitHub with git push

Pull Requests on GitHub

A pull request is how you tell others, "Hey, I've got some changes I think we should add." Here's how it goes:

  • On GitHub, you can start a pull request from your branch to the main branch.
  • Other people will look at your changes and might give suggestions.
  • If you need to, add more changes by making more commits to your branch.
  • Once everyone's happy, your changes get added to the project!

With these simple steps, you're ready to start helping out with projects by using Git.

Finding Open Source Projects to Contribute To

Looking for open source projects to help out with might seem tough at first, but there are plenty of cool ones out there for everyone, no matter your skill level. Here's how to find projects that you'll be excited about:

GitHub has special spots where it shows off open source projects:

  • Explore is where you can find new and interesting projects in different areas and programming languages.
  • Trending points out projects that are getting a lot of action lately.

Take a look here to find projects that grab your attention. Try to pick ones that use languages or tools you already know or want to learn.

Use Filters

On GitHub, you can look for open source projects and make your search more specific:

  • Use the language filter to find projects in Python, JavaScript, C++, and more.
  • Use the number of contributors filter to see projects with more or fewer people.
  • Use the latest activity filter to find projects that are currently active.

You can mix and match these filters to find the perfect project for you.

Check "Good First Issue" and "Help Wanted" Labels

Some projects have special tags for easy tasks called Good First Issue or Help Wanted.

You can search for these on GitHub. It's an easy way to find simple tasks to start with.

Follow Developers You Admire

Look at what projects your favorite developers are working on.

If they're contributing to a project, it's likely friendly to beginners and they're good about helping new people. It's worth checking out their projects.

Ask Your Community

Talk to people you know who code, like friends, classmates, or coworkers. They might know of some great open source projects to start with.

Their own experiences can lead you to projects that are welcoming to newcomers.

With a little bit of searching on GitHub and talking to people you know, you can find open source projects that fit what you're good at and what you're interested in. Start with something small, be helpful, and enjoy the process!

How to Fork and Clone a Repository

Forking and cloning repositories are your first steps into contributing to open source projects on GitHub. Let's break it down:

Fork the Repository

  1. Go to the GitHub page of the project you're interested in.
  2. Click the "Fork" button at the top right. This makes a copy of the project under your GitHub account.

Clone Your Fork Locally

  1. Head to your version of the repository on GitHub.
  2. Press the "Code" button and copy the web address.
  3. Open your command line tool and go to where you want the project to be on your computer.
  4. Type git clone, then paste the web address you copied:
git clone https://github.com/YOUR-USERNAME/YOUR-FORKED-REPO
  1. Hit Enter. This makes a copy of the project on your computer.

Keep Your Fork Synced

The original project will update over time. To keep your copy up to date:

git remote add upstream https://github.com/UPSTREAM-USER/ORIGINAL-REPO.git
git fetch upstream
git checkout main
git merge upstream/main 

This stops any problems when you're ready to add your changes. Now you're all set to start making your mark. Have fun coding!

Understanding Issues and Pull Requests

Issues and pull requests are how you can help out with open source projects on GitHub. Let's break down what they are and how to use them:

What Are Issues?

Think of an issue as a note saying there's something that needs fixing or improving in a project, like:

  • Bugs - These are problems in the code that make things go wrong or not work as expected.
  • Enhancements - Suggestions for new features or ideas to make the project better.
  • Tasks - Small jobs that need to be done, such as correcting spelling mistakes or updating information.

Anyone can use issues to discuss these points in a project.

Creating an Issue

If you see something that needs work, you can let everyone know by creating an issue:

  1. Go to the Issues tab on the project's GitHub page.
  2. Click the green New issue button.
  3. Write a title and description explaining the problem.
  4. Hit Submit new issue to finish.

Be clear and detailed in your title and description to help others understand the issue.

Working on Issues

Issues often have labels like bug, enhancement, or question to show what they're about. These can help you find issues you might want to work on.

To start working on an issue:

  • Leave a comment saying you'll take a look.
  • If you can, assign yourself to the issue.

This lets everyone know you're working on it.

Submitting Pull Requests for Issues

Once you've fixed an issue in your local copy:

  1. Commit your changes with clear messages.
  2. Push your changes to your GitHub fork.
  3. Make a pull request to the project.
  4. In your pull request message, mention the issue using #123.

This links the issue and your pull request together.

What Are Pull Requests?

A pull request (or PR) is your way of sharing your fixes or improvements with the original project. It's like saying:

Look, I made some changes that could help!

PRs show what's different between your work and the project. Others can review your changes and give feedback.

If they like your changes, they'll add them to the project. Then, your work is part of the bigger project shared by everyone!

Submitting Pull Requests

Most projects have rules for PRs in their CONTRIBUTING file. Generally, you should:

  1. Fork the project to your account.
  2. Clone your fork to your computer.
  3. Create a branch for your changes.
  4. Commit your changes with notes.
  5. Push your branch to your fork on GitHub.
  6. Make a pull request from your branch on GitHub!

From making clear notes to following the project's coding style, learning to submit pull requests well takes some practice. But don't worry, projects are usually happy to help beginners.

With a bit of practice, you'll find creating issues and pull requests rewarding. It feels great to see your work help improve software for everyone!

sbb-itb-bfaad5b

Making Your First Contribution

Step 1: Fork the desired project

To start helping out with an open source project on GitHub, you first need to make your own copy of it. Here's how:

  1. Go to the project's GitHub page you're interested in.
  2. Hit the "Fork" button at the top right. This makes a copy under your account.

This step lets you mess around with the project without messing up the original.

Step 2: Clone the Project

Next, you need to make a local copy of the project on your computer:

  1. Go to your version of the project on GitHub.
  2. Press the "Code" button and copy the URL.
  3. Open your command line, navigate to where you want the project to live, and type git clone <forked-project-url>. Press Enter.

Now you have the project on your computer.

Step 3: Create A New Branch

Before changing anything, make a new branch by typing:

git checkout -b <branch-name>

This keeps your changes separate from the main project until they're ready to be shared.

Step 4: Develop, Stage, and Commit

Now you can start making your changes. Remember to:

  • Fix bugs or add features.
  • Test your changes well.
  • Get your changes ready with git add <files>.
  • Save your changes with git commit -m "<message>".

Keep your update messages clear to track what you've done.

Step 5: Push the Changes

After making your changes, share them with your GitHub fork by typing:

git push origin <branch-name>

This updates your online copy with what you've done.

Step 6: Create a Pull Request

The last step is to ask the original project to include your changes:

  1. Go to your fork on GitHub, pick your branch, and click "Pull request".
  2. Title and describe what you did.
  3. Wait for feedback. You might need to make more changes.
  4. Keep updating if needed until your changes are accepted.
  5. Give yourself a pat on the back when your changes are included!

Follow these steps, and you've just helped out with open source!

Review and Merge: What Happens After You Submit a Pull Request

After you send in your pull request, here's what usually goes down:

Code Review

  • The folks running the project and other helpers will look over your work to check it's up to scratch.
  • They'll be on the lookout for any mistakes, things that don't fit the project's style, or stuff that's not needed.
  • You might get some comments asking about your work or suggesting tweaks.

Respond to Feedback

  • If you get questions or suggestions, reply nicely right there in the pull request.
  • Go ahead and make any changes they suggest if you think they make sense.
  • If you don't agree with a suggestion, kindly explain why.
  • If you need to make updates, just add more commits to your pull request.

Wait for Approval

  • Once you've dealt with any feedback, someone will give your pull request the thumbs up.
  • If there's still stuff to fix, they'll let you know what needs more work.

Your Code Gets Merged

  • After getting the green light, someone will add your changes to the main project.
  • Yay! You've just helped improve the project!

Next Steps

  • Check that everything's working right with your changes in the main project.
  • If something's off, tell the project leaders.
  • Think about sticking around to help with another issue.

The review step makes sure everything added to the project is top-notch. Don't sweat it if you get a lot of feedback. It's all part of getting better. The more you do this, the easier it gets to make contributions that everyone's happy with right away.

Additional Ways to Contribute

Helping with open source isn't just about coding. Here are some other ways you can make a difference:

Improve Documentation

Every project needs clear instructions so people can understand how to use it. You can help by:

  • Fixing links that don't work or spelling mistakes
  • Adding examples or pictures
  • Making instructions clearer
  • Explaining hard topics in a simple way

Design Assets

If you're good at design, you can help make things like logos, banners, or designs for t-shirts that help the project stand out.

Write Tutorials and Blog Posts

Talk about what you've learned from the project. You can write guides, blog about it, give talks, or run workshops. Telling others about the project is super helpful.

Answer Questions

Help out by answering questions in the project's forums. Your advice can help new people get started.

Test New Features

Try out new things before they're fully released. Spotting problems early can save a lot of trouble later.

Organize Events

You can help bring people together by organizing online meetups, hackathons, or other events related to the project.

Some projects need money for things like website hosting or paying for extra help. If you can, giving money helps keep the project going.

There are lots of ways to help out with a project, even if you're not coding. Your efforts help make the project better for everyone.

Building a Habit of Contributing

Making open source contributions a regular part of your life means being consistent and putting in the effort. Here's how to get into the groove:

Set Aside Contribution Time

  • Block out 30-60 minutes a few times a week just for open source work.
  • Put it on your calendar like any other important activity.
  • Starting with a little bit of time and then adding more as you get comfortable is okay.

Join Project Communities

  • Get involved in chats like Slack, Discord, or IRC for the projects you're interested in.
  • Say hi and ask for simple tasks to start with.
  • Staying connected makes it easier to keep contributing.

Find a Contribution Buddy

  • Team up with someone who also wants to contribute to open source.
  • Promise to keep each other on track with regular contributions.
  • Having a friend involved can really help keep you going!

Set Public Commitment Goals

  • Take part in events like hacktoberfest or 24 pull requests.
  • Telling others about your goals can motivate you to achieve them.
  • It feels great to hit your targets.

Give Back to Projects You Use

  • Think about the open source tools you use every day.
  • Dedicate some time each month to help improve these projects.
  • Working on tools you use is a great way to get better at what you do.

Don't Worry About Expertise

  • Don't think you have to be a pro to help out.
  • Just aim to be useful, no matter your skill level.
  • You'll learn and become better as you contribute more.

Appreciate All Contributions

  • Remember, it's not just about coding. Documentation, design, and other tasks are important too.
  • Find what you're good at and do your part.
  • Every bit of help makes the project stronger.

Getting into the habit of contributing to open source takes some planning and motivation, but the rewards in learning and being part of a community are worth it. By making time, finding ways to stay motivated, and focusing on being helpful, you can make open source contributions a regular part of your life.

Conclusion

Jumping into open source projects might seem a bit scary at first, but we hope this guide has made it feel more doable for everyone, no matter how new you are to coding. From setting up your GitHub account the right way, to getting the hang of Git, finding a project you're excited about, and figuring out how to send in your ideas and fixes, you're all set to make the open source community even better.

The good stuff about helping out is pretty clear. You get to improve the software you use and love. You pick up new skills and get better at what you know by actually doing it. Plus, you join a worldwide group of people who love to code and work together.

Here are a few final tips:

  • Starting with small things like fixing typos or making the instructions clearer is totally okay. Every little bit helps, and it's a great way to get comfy with the process.
  • Say hi in the project's chat rooms, like IRC or Slack. Meeting the community helps you learn from others.
  • If you're stuck, don't be shy to ask for help! The people in the project want you to do well.
  • Try to help out regularly, but don't overdo it. Doing a little bit often is better than doing too much all at once.
  • Once you've got some experience, help new people out. Sharing what you know is what makes open source great!

The open source community is always looking for more people to help. You can do it! Start with small steps, be kind, and enjoy meeting people from all over the world. The code and the community will be better for it.

Should I contribute to open source as a beginner?

Yes, starting with open source is a great idea for beginners. Here’s why:

  • Improve skills: You get to work on real projects. This could be coding, designing, writing, or organizing.
  • Learn new things: It’s a perfect way to learn new skills in a practical setting.
  • Showcase your work: Your contributions can impress future employers.
  • Gain references: People you work with on projects can recommend you based on your contributions.
  • Build confidence: Successfully contributing boosts your confidence.

Start with easy tasks like fixing small errors, improving documents, or making websites better. As you get more comfortable, you can take on bigger challenges.

How do I contribute to open source GitHub as a beginner?

Here are some beginner-friendly ways to contribute:

  • Reproduce bugs: Help by showing how a bug can be created. Mention what computer or browser you’re using.
  • Test pull requests: Download code changes, test them out, and look for any problems.
  • Update documentation: Fix mistakes, add examples, or improve clarity.
  • Make website changes: Adjust text, update design, or fix layout issues easily.
  • Take on easy issues: Work on small bugs or improve error messages.
  • Submit localization: Help by translating text to different languages.

Start with what you can, ask questions, and be patient as you learn.

How do I start a contribution on GitHub?

To start contributing, follow these steps:

  1. Fork the project to your account.
  2. Clone your fork to your computer and start a new branch.
  3. Make changes, commit them with clear descriptions.
  4. Push your branch to your fork on GitHub.
  5. Open a pull request to the original project.
  6. Wait for feedback, make any needed changes until your work is merged.

Make sure to read the project’s guidelines to fit in with their expectations.

Should beginners use GitHub?

Absolutely, GitHub is great for beginners because:

  • Version control: It helps you keep track of changes and go back if needed.
  • Collaboration: You can work with others easily.
  • Visibility: Show off your projects and what you’ve contributed to.
  • Community: Connect with developers worldwide.
  • Documentation: There are tons of guides and videos to help you learn.
  • Accessibility: It’s free for public projects and easy to use.

GitHub’s simple setup makes it a friendly choice for new developers. It’s a place where you can learn a lot by joining in on open source projects.

Related posts

Why not level up your reading with

Stay up-to-date with the latest developer news every time you open a new tab.

Read more