Skip to main content

First Open Source Project – Making Your First Contribution

Introduction​

Welcome to your first open source contribution! In this tutorial, you will learn how to contribute to an open source project directly through GitHub's web interfaceβ€”no command line required! This is perfect for beginners who want to start contributing to open source projects.

What is Open Source?​

Open source software is code that is freely available for anyone to view, use, modify and distribute. Contributing to open source projects helps you:

  • Learn from real-world code
  • Build your portfolio
  • Connect with the developer community
  • Improve your coding skills
  • Give back to projects you use

Prerequisites​

Before starting, make sure you have:

  • A GitHub account (create one at github.com)
  • Basic understanding of Git and GitHub concepts.
  • Willingness to learn and contribute!

The Contribution Workflow​

The typical open source contribution workflow involves:

  1. Fork the repository
  2. Edit the files
  3. Commit your changes
  4. Create a pull request
  5. Wait for review and feedback

Let's walk through each step!

Step 1: Find the Repository​

Navigate to the practice repository: https://github.com/sanjay-kv/Open-source-Practice

This is a beginner-friendly repository designed for practicing open source contributions.

https://github.com/sanjay-kv/Open-source-Practice

GitHub

Step 1: Repository Home Page

Take a moment to:

  • Read the README file to understand the project
  • Check if there are contribution guidelines (CONTRIBUTING.md)
  • Look at existing issues or pull requests
  • Understand what kind of contributions are welcomed

Step 2: Fork the Repository​

Forking creates your own copy of the repository where you can make changes without affecting the original project.

  1. Click the Fork button in the top-right corner of the repository page
  2. Select your account as the destination
  3. Wait for GitHub to create your fork
https://github.com/sanjay-kv/Learn-GitHub/fork

GitHub

Step 2: Forking the Repository

https://github.com/sandemouser/Learn-GitHub

GitHub

Step 3: Fork Button Location

Once the fork is complete, you'll see:

  • Your username in the repository name
  • A note saying "forked from [original-repo]"
https://github.com/sandemouser/Learn-GitHub

GitHub

Step 4: Fork Complete

Step 3: Edit files directly on GitHub​

One of the great features of GitHub is the ability to edit files directly in your browser without cloning the repository to your computer.

Finding the File to Edit​

  1. Navigate to the file you want to edit (usually specified in the project's README)
  2. Click on the file name to view it
  3. Click the pencil icon (✏️) in the top-right corner to edit

Making Your Changes​

For this practice repository, you'll typically add your name to a contributors list:

https://github.com/sandemouser/Learn-GitHub

GitHub

Step 5: Add Your Name

Common first contributions include:

  • Adding your name to a contributors list
  • Fixing a typo in documentation
  • Updating outdated information
  • Adding a translation
  • Improving README formatting
https://github.com/sandemouser/Learn-GitHub

GitHub

Step 6: Changes Made

Best Practices for Making Changes
  • Keep changes small and focused - Don't try to fix multiple things at once
  • Follow the project's style - Match the formatting and conventions used
  • Test your changes - Make sure links work and formatting is correct
  • Read contribution guidelines - Many projects have specific requirements
  • Be respectful - Remember real people maintain these projects

Step 4: Commit your changes​

After making your edits, you need to commit them. A commit is like saving a snapshot of your changes with a description.

Writing a good commit message​

  1. Scroll down to the "Commit changes" section
  2. Write a clear, concise commit message describing what you changed
  3. Optionally add a longer description if needed
  4. Select "Commit directly to the main branch" for simple changes
  5. Click Commit changes
https://github.com/sandemouser/Learn-GitHub

GitHub

Step 7: Commit Changes

Good commit message examples:

  • βœ… "Add John Doe to contributors list"
  • βœ… "Fix typo in installation instructions"
  • βœ… "Update Python version requirement"

Poor commit message examples:

  • ❌ "Update"
  • ❌ "Changes"
  • ❌ "asdfasdf"
https://github.com/sandemouser/Learn-GitHub

GitHub

Step 8: Final Commit Review

Step 5: Create a Pull Request​

Now that you've made changes in your fork, it's time to propose those changes to the original repository through a Pull Request (PR).

What is a Pull Request?​

A Pull Request is a way to propose changes to a repository. It allows:

  • Project maintainers to review your changes
  • Discussion about the proposed modifications
  • Automated tests to run on your code
  • Iterative improvements before merging

Steps to Create a Pull Request​

  1. Navigate to the original repository (not your fork)
  2. Click on the Pull Requests tab
  3. Click the green New pull request button
  4. Click Compare across forks
  5. Select your fork and branch from the dropdowns
    • Base repository: The original project
    • Head repository: Your fork
    • Base branch: Usually main or master
    • Compare branch: Your branch with changes
  6. Review the changes shown in the diff
  7. Click Create pull request
  8. Add a descriptive title and detailed description
  9. Click Create pull request again to submit
https://github.com/sandemouser/Learn-GitHub

GitHub

Step 9: Create Pull Request

Writing a Good Pull Request Description​

Your PR description should include:

  • What changes you made
  • Why you made them
  • How to test the changes (if applicable)
  • Screenshots (if it's a visual change)
  • Related issues (if fixing a bug or implementing a feature)

Example PR description:

## Description
Added my name to the contributors list as per the contribution guidelines.

## Changes Made
- Added "John Doe" to CONTRIBUTORS.md
- Maintained alphabetical ordering

## Checklist
- [x] Followed the project's style guidelines
- [x] Checked for typos
- [x] Read the contribution guidelines

Understanding "Compare Across Forks"​

The Compare across forks feature is crucial for creating pull requests from your fork to the original repository.

What Does It Do?​

This feature allows you to compare changes between:

  • Your forked repository (where you made changes)
  • The original repository (where you want to contribute)

Why Is It Important?​

The comparison view shows:

  • All commits you've made since forking
  • File changes in a diff format
  • Additions highlighted in green
  • Deletions highlighted in red
  • Conflict warnings if there are any

How to Use It Effectively​

  1. Select the correct branches:

    • Base: Original repository's main branch
    • Compare: Your fork's branch with changes
  2. Review the diff carefully:

    • Ensure only intended changes are included
    • Check for accidental modifications
    • Verify formatting is correct
  3. Look for conflicts:

    • Red warnings indicate merge conflicts
    • Update your fork if needed
    • Resolve conflicts before creating PR

Benefits of Comparing​

  • Prevents mistakes - Catch unintended changes early
  • Improves quality - Review your work before submission
  • Reduces conflicts - Identify issues before they become problems
  • Saves time - Avoid back-and-forth with maintainers
  • Shows professionalism - Demonstrates attention to detail
Important Notes
  • Always check the diff before creating a PR
  • Make sure you're comparing the right branches
  • If you see unexpected changes, fix them before submitting
  • Keep your fork updated to avoid conflicts

Step 6: Wait for Review​

After creating your pull request:

  1. Wait patiently - Maintainers review PRs on their schedule
  2. Respond to feedback - Be open to suggestions and changes
  3. Make requested changes - Update your PR based on feedback
  4. Stay professional - Be courteous and respectful

Watch This Video Tutorial​

For a visual walkthrough of the entire process, watch this helpful video:

Finding Projects to Contribute To​

Beginner-Friendly Resources​

Types of Contributions​

You don't have to write code to contribute:

  • πŸ“ Documentation - Fix typos, improve clarity, add examples
  • 🌐 Translation - Translate docs or UI to other languages
  • πŸ› Bug Reports - Report issues you encounter
  • πŸ’‘ Feature Suggestions - Propose new features
  • 🎨 Design - Improve UI/UX
  • βœ… Testing - Test new features and report results
  • πŸ“Š Data - Add datasets or examples
  • ❓ Support - Help answer questions in issues

Conclusion​

Congratulations! You've learned how to make your first open source contribution using only GitHub's web interface. You now know how to:

  • βœ… Fork a repository
  • βœ… Edit files directly on GitHub
  • βœ… Commit changes with meaningful messages
  • βœ… Compare changes across forks
  • βœ… Create pull requests