Best Practices

How to Make Your First Open Source Code Contribution

Priyansh Narang

Priyansh Narang

Community Manager

December 8, 2025
25 min read

#The Part Nobody Talks About

Everyone says "just make a pull request." As if that explains anything.

The reality is that making your first code contribution to open source is confusing. Not because the code is hard, but because everything around the code is unfamiliar. Where do you even start? How do you know what to work on? What if you break something?

Here's what actually happens when you make your first contribution, and how to get through it without overthinking.

#Before You Touch Any Code

The biggest mistake beginners make is diving straight into code. You need context first.

#Pick a project you've actually used

Don't contribute to Linux kernel or React just because they're famous. Pick something you've installed and used at least a few times. You'll understand the problem space better and care more about the outcome.

#Read the project like a user first

  • Install the project locally
  • Try to break it (seriously, click around and try edge cases)
  • Read the existing issues to see what problems people are having
  • Look at closed pull requests to see what gets accepted

This takes maybe an hour and saves you days of wasted effort later.

#Find the contribution guidelines

Look for files named:

  • CONTRIBUTING.md
  • README.md (usually has a "Contributing" section)
  • .github/CONTRIBUTING.md

These tell you:

  • How to set up the development environment
  • What the code review process looks like
  • What kinds of contributions they want
  • Any specific style guides or testing requirements

If there aren't any guidelines, that's actually useful information - it means the project is either new or maintainers are stretched thin. Both mean they'll probably be grateful for help.

#Finding Your First Issue

Don't try to add a major feature. Your goal is to get one pull request merged so you understand the process.

#Look for these labels:

  • good first issue
  • beginner friendly
  • help wanted
  • documentation
  • easy

#What makes a good first issue:

Small scope: Can you describe the change in one sentence? Good. If it requires a paragraph, it's probably too complex for a first contribution.

Clear requirements: The issue should explain what needs to change. If it says "this should work better," that's vague. If it says "error message should show the filename," that's clear.

Recent activity: If the issue was opened yesterday and has responses from maintainers, it's active. If it was opened three years ago with no responses, it's probably dead.

#Red flags to avoid:

  • Issues with 50+ comments (too much disagreement about the solution)
  • Issues asking for "any help" (too vague)
  • Issues marked "good first issue" but with complex technical discussion in comments
  • Issues that haven't been responded to by maintainers in months

#Setting Up Your Development Environment

This is where most people give up. Don't let bad documentation defeat you.

#The typical setup process:

  1. Fork the repository

    • Click the "Fork" button on GitHub
    • This creates your own copy of the project
  2. Clone your fork locally

    git clone https://github.com/YOUR_USERNAME/project-name
    cd project-name
    
  3. Install dependencies

    • Usually npm install, pip install -r requirements.txt, or similar
    • Check the README for specific instructions
    • This often fails the first time—that's normal
  4. Run the tests

    • Make sure everything works before you change anything
    • Commands are usually in the README or CONTRIBUTING file
    • If tests don't pass initially, that's a bug in the project (mention it)

#When setup fails:

Don't struggle silently. Ask for help:

  • Check if there's a Discord, Slack, or discussion forum
  • Post in the issue: "I'm trying to work on this but having trouble setting up the environment. Here's my error..."
  • Maintainers want you to succeed. They'll usually help

Platforms like Open Source Connect Global (OSCG) often have community channels specifically for setup help. Use them.

#Making Your Change

Finally, the coding part. This should be the easiest step if you've done everything above.

#The workflow:

  1. Create a new branch

    git checkout -b fix-error-message
    
    • Name it something descriptive
    • Don't work on the main branch
  2. Make the smallest change that solves the problem

    • Resist the urge to fix other things you notice
    • One issue = one pull request
    • You can refactor later after you're familiar with the project
  3. Test your change

    • Run the project locally and verify it works
    • Run the test suite
    • Add tests if the project expects them (check CONTRIBUTING.md)
  4. Commit with a clear message

    git commit -m "Fix: Show filename in error message when file not found"
    
    • Start with a verb: Fix, Add, Update, Remove
    • Explain what changed, not why (that goes in the PR description)

#Creating Your Pull Request

This is where you explain your work to the maintainers.

#What to include in your PR description:

What you changed:

  • "Updated error message in file_handler.py to include filename"

Why you changed it:

  • "Resolves #123. Users were confused about which file was missing because the error message didn't specify."

How to verify it:

  • "Run the app with an invalid filename and check that the error shows the filename"

Checklist (if the project provides one):

  • Tests pass locally
  • Added tests for new functionality
  • Updated documentation if needed

#Good PR practices:

  • Link to the issue you're solving (Fixes #123 or Closes #123)
  • Keep it focused - one PR should solve one problem
  • Add screenshots if it's a visual change
  • Be responsive to feedback (check GitHub notifications daily)

#Handling Code Review Feedback

This is where beginners get discouraged. Maintainers will ask you to change things. That's not rejection - that's how code review works.

#Common feedback you'll get:

Can you add tests for this?

  • They want to make sure your fix doesn't break in the future
  • Ask for examples if you don't know how to write tests for this project

This doesn't follow our style guide

  • They might want different variable names, formatting, or structure
  • Just make the changes - it's not personal

Actually, we need to solve this differently

  • They might have context you don't about why certain approaches won't work
  • Ask questions to understand their perspective

Can you rebase this?

  • The main branch changed since you started
  • This is a technical Git thing - ask for help if you don't know how

#How to respond:

  • Thank them for the review
  • Ask questions if something isn't clear
  • Make the requested changes
  • Push your updates (they'll automatically appear in the PR)

Example responses:

  • "Good catch, I'll add those tests."
  • "I'm not familiar with that pattern - can you point me to an example in the codebase?"
  • "Updated! Let me know if this is what you had in mind."

#After Your PR Gets Merged

Congratulations. You're now an open-source contributor.

#What happens next:

Your change gets merged into the main branch and ships with the next release. Your name goes in the contributors list. You can link to your PR on your resume or LinkedIn.

#Keep the momentum going:

  • Look for another issue in the same project (now you understand the codebase)
  • Help other newcomers who are struggling with setup
  • Review other people's PRs if you feel confident
  • Gradually take on more complex issues

#When Things Don't Go Smoothly

Not every contribution gets merged. That's fine.

#Reasons a PR might get rejected:

The project changed direction

  • Maintainers decided not to fix that issue after all
  • Not your fault - just bad timing

Your approach doesn't fit the architecture

  • You solved the problem, but not in a way that works for the project
  • Ask if there's a different approach they'd accept

The maintainer is unresponsive

  • Some projects are abandoned or maintainers are busy
  • Move on to a different project if you don't hear back in a week

The fix is more complex than expected

  • What looked like a simple issue turns out to require major changes
  • It's okay to say "This is beyond my current skill level" and close your PR

#Learning from rejection:

Every rejected PR teaches you something:

  • How to evaluate if an issue is actually simple
  • What maintainers look for in contributions
  • How to communicate technical decisions

#Common First Contribution Mistakes

Everyone makes these. Learn from them:

Trying to fix too much at once

  • You see 5 related issues and try to fix them all in one PR
  • Maintainers want small, focused changes
  • Fix one thing, get it merged, then fix the next

Not reading the contributing guidelines

  • The project wants tests, you don't include them
  • The project has a style guide, you ignore it
  • Maintainers will just ask you to fix it, but you waste time

Working on something already claimed

  • Someone commented "I'm working on this" two days ago
  • Check the comments before you start
  • Ask "Is anyone working on this?" if unclear

Taking feedback personally

  • Code review can feel harsh, especially in text
  • Maintainers aren't attacking you, they're protecting code quality
  • Focus on what you're learning, not on ego

#Resources That Actually Help

When you're stuck with Git:

  • Oh Shit, Git! (ohshitgit.com) - fixes for common Git mistakes
  • GitHub's documentation is actually good

When you're stuck with code:

  • The project's chat/forum (Discord, Slack, Discussions)
  • OSCG community channels for general questions
  • Stack Overflow (search first, many questions already answered)

When you're stuck finding issues:

  • goodfirstissue - aggregates beginner-friendly issues
  • up-for-grabs.net - similar, different projects
  • OSCG project recommendations based on your skills

#The Real Goal

Your first contribution isn't about writing perfect code. It's about learning the process.

You're learning:

  • How open-source workflows work
  • How to take feedback without defensiveness
  • How to communicate technical changes
  • How real projects are structured

These skills compound. Your second contribution will be easier. Your tenth will feel routine. Your hundredth will be where you're helping others make their first contribution.

That's the path. Start small, learn the process, build from there.