keepcalculator

06 Numbers and Powers

First Open Source Contribution: Step-by-Step Guide

Card No. 06·21297 · Updated · Standard formula, shown below

This guide walks you through making your first open source contribution, from finding a project to getting your pull request merged. You’ll learn the practical steps, common pitfalls, and how to handle setbacks, so you can contribute with confidence.

What You’ll Need

  • A GitHub account (free)
  • Git installed on your computer
  • A code editor (VS Code, Sublime, etc.)
  • Basic command line familiarity
  • Patience and a willingness to learn

Step-by-Step

  1. Find a project that interests you. Look for projects you already use or that solve a problem you care about. Check the “issues” tab for labels like “good first issue” or “beginner friendly.” These are usually well-scoped and have maintainers ready to help.
  2. Read the contribution guidelines. Most projects have a CONTRIBUTING.md file in the root directory. It explains how to set up the project, coding standards, and how to submit changes. Follow it exactly.
  3. Understand the project’s license and code of conduct. Make sure you’re comfortable with the license (e.g., MIT, GPL). The code of conduct sets expectations for respectful communication.
  4. Set up the project locally. Fork the repository (click “Fork” on GitHub), then clone your fork to your computer: git clone https://github.com/your-username/project.git. Add the original repo as an upstream remote: git remote add upstream https://github.com/original-owner/project.git.
  5. Create a branch for your work. Never commit directly to main. Use a descriptive branch name: git checkout -b fix-typo-in-readme.
  6. Make your changes. Start small. Fix a typo, improve documentation, or add a comment. If you’re fixing a bug, reproduce it first, then write a test that fails, then fix the code. Ensure your changes follow the project’s style (indentation, naming, etc.).
  7. Test your changes. Run the project’s test suite. If there’s no test suite, at least manually verify your change works as expected. Add tests if the project expects them.
  8. Commit your changes. Write a clear commit message: git add . then git commit -m "Fix typo in installation instructions". Use the imperative mood and keep the subject under 50 characters.
  9. Push your branch to your fork: git push origin fix-typo-in-readme.
  10. Open a pull request (PR). Go to your fork on GitHub and click “Compare & pull request.” Fill in the template: describe what you changed, why, and any related issues. Reference the issue number if applicable (e.g., “Closes #123”).
  11. Respond to feedback. Maintainers may request changes. Make the requested edits on the same branch, commit, and push. The PR updates automatically. Be polite and patient.
  12. Celebrate when merged. Once your PR is merged, you’re officially an open source contributor! Delete your branch locally and on GitHub to keep things tidy.

Common Mistakes

  • Not reading the contribution guidelines. Each project has its own workflow. Skipping this can lead to rejected PRs.
  • Making large, sweeping changes. A 500-line PR is hard to review and more likely to be rejected. Start small.
  • Ignoring the code style. If the project uses tabs, don’t use spaces. Most have linting tools—run them.
  • Not testing. Submitting code that breaks existing tests is a quick way to get a negative response.
  • Committing directly to main. Always use a separate branch. This keeps your fork clean and makes multiple PRs easier.
  • Not updating your fork before starting. If you fork an old version, your changes may conflict with the latest code. Always pull the latest upstream changes first.

Tips

  • Start with documentation. Fixing a typo or clarifying a sentence is a low-risk way to learn the workflow.
  • Look for the “good first issue” label. Maintainers use this to signal that the issue is approachable for newcomers.
  • Comment on an issue before starting. Say “I’d like to work on this” to avoid duplication and get guidance.
  • Use the project’s communication channels. Many projects have a Slack, Discord, or mailing list. Ask questions there if you’re stuck.
  • Keep your PR focused. One PR should solve one problem. If you find another bug, open a separate issue.
  • Be patient. Maintainers are often volunteers. It may take days or weeks for a response. That’s normal.

Troubleshooting

If your PR is rejected or you hit a wall, here’s what to do:

  • Merge conflicts. If your branch is behind upstream, rebase: git fetch upstream, git rebase upstream/main, resolve conflicts, then git push --force-with-lease.
  • Tests failing. Run the tests locally. If they fail, check the error messages. It might be a dependency issue—run npm install or pip install -r requirements.txt again.
  • No response from maintainers. After a week, politely ping the PR with a comment like “Just checking in—any feedback on this?” Avoid spamming.
  • PR closed without explanation. Re-read the contribution guidelines. If you think it’s a mistake, comment on the PR asking for clarification. Be respectful.
  • You’re stuck on a technical problem. Search the project’s issues and documentation. If no luck, ask in the project’s chat or forum. Provide details about what you tried.

Frequently Asked Questions

Do I need to be an expert programmer to contribute?

No. Many contributions are documentation, bug fixes, or small features. Even fixing a typo is valuable. Start with what you know.

What if I don’t know how to code at all?

You can still contribute by improving documentation, translating, designing logos, or answering user questions. Look for “non-code” contributions.

How do I choose a project?

Pick something you use or are curious about. Check the issue tracker for beginner-friendly labels. Also, look at the project’s activity—if the last commit was years ago, it might be inactive.

Can I make a contribution without forking?

Some projects accept direct commits if you’re a maintainer, but for everyone else, forking and PR is the standard workflow.

What if my PR is ignored?

Wait a week, then gently ask for feedback. If there’s still no response, it may be an inactive project. Try another one.

Is it okay to submit a PR for an issue that’s already assigned?

Generally no. If someone is already assigned, they’re working on it. Look for unassigned issues or ask if you can take over.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →