DEV Community

Cover image for How to Make Your First Open Source Contribution – The Easy Way!
Nitish
Nitish

Posted on

How to Make Your First Open Source Contribution – The Easy Way!

Contributing to open source can feel intimidating when you’re just getting started. But thanks to repositories like First Contributions, your journey into the world of open source can be smooth, guided, and beginner-friendly.

In this article, I’ll walk you through:

  • Setting up Git and SSH (Windows, macOS, Linux)
  • Forking and cloning a repository
  • Making your first pull request (PR)

Let’s dive in!


Step 1: Set Up Git

If you haven’t already, install Git on your machine:

For Windows:

  1. Download and install Git from 👉 https://git-scm.com/downloads
  2. During installation, choose default options unless you have specific preferences.
  3. After install, open Git Bash (or your terminal of choice).

For macOS:

brew install git
Enter fullscreen mode Exit fullscreen mode

For Linux:

sudo apt install git
Enter fullscreen mode Exit fullscreen mode

Now configure Git (same email as your GitHub account):

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Enter fullscreen mode Exit fullscreen mode

Step 2: Generate SSH Key (if not done yet)

SSH lets your computer securely connect to GitHub without typing your username and password each time.

Check if you already have one:

ls -al ~/.ssh
Enter fullscreen mode Exit fullscreen mode

Look for files like id_rsa or id_ed25519.

If not, create one:

ssh-keygen -t ed25519 -C "your_email@example.com"
Enter fullscreen mode Exit fullscreen mode
  • Press Enter to accept the default file location.
  • Optionally set a passphrase for more security.

Add the SSH key to your GitHub account:

  1. Copy your SSH key:
cat ~/.ssh/id_ed25519.pub
Enter fullscreen mode Exit fullscreen mode

Copy the entire output.

  1. Go to 👉 GitHub SSH settings, click "New SSH key", give it a title, and paste the key.

Test the connection:

ssh -T git@github.com
Enter fullscreen mode Exit fullscreen mode

If successful, you’ll see:

Hi your-username! You've successfully authenticated.
Enter fullscreen mode Exit fullscreen mode

For Windows Users:

Make sure to use Git Bash or WSL terminal for the above commands.


Step 3: Fork the Repository

Head over to the First Contributions GitHub Repo and click the "Fork" button on the top-right to create a copy of the repo under your GitHub account click on SSH.


Step 4: Clone the Forked Repository

Use SSH to clone your fork locally:

git clone git@github.com:your-username/first-contributions.git
cd first-contributions
Enter fullscreen mode Exit fullscreen mode

Step 5: Create a New Branch

It's good practice to create a separate branch for your changes:

git checkout -b add-your-name
Enter fullscreen mode Exit fullscreen mode

Step 6: Add Your Name

Open the Contributors.md file in your editor and add your name at the end of the list. Example:

- [Your Name](https://github.com/your-username)
Enter fullscreen mode Exit fullscreen mode

Step 7: Commit Your Changes

Stage and commit your changes:

git add Contributors.md
git commit -m "Add Your Name to Contributors list"
Enter fullscreen mode Exit fullscreen mode

Step 8: Push Your Changes

git push origin add-your-name
Enter fullscreen mode Exit fullscreen mode

Step 9: Submit a Pull Request (PR)

  1. Go to your forked repository on GitHub.
  2. Click "Compare & pull request".
  3. Add a descriptive title and comment.
  4. Click "Create pull request".

🎉 That’s it! You just made your first open source contribution! A maintainer will review your PR and merge it once approved.


Bonus: Use Their Interactive Tutorial

Want to try this in the browser without installing Git?

Check out 👉 https://firstcontributions.github.io – an interactive Git tutorial via Gitpod. No setup required!


Final Thoughts

The first-contributions repo is a great place to break the ice in open source. It’s designed to teach, encourage, and guide.

If you’ve made your first PR, congrats! 🥳
Now you’re ready to explore more projects and make meaningful contributions to the tech community.

Feel free to share your first PR or ask questions in the comments below! 👇


Helpful Links

Top comments (0)