🤝 Open Source Contribution Guide (Beginner
Friendly)
This guide walks you through how to contribute to open source projects on
GitHub using Git, especially for beginners. It includes all the necessary steps,
command-line examples, common cautions, and a smooth workflow.
🌱 Prerequisites
Git installed (git --version)
GitHub account set up
SSH key added to GitHub (see GitHub > Settings > SSH and GPG keys)
🔧 One-Time SSH Setup (Optional but Recommended)
ssh-keygen -t ed25519 -C "your_email@[Link]"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
cat ~/.ssh/id_ed25519.pub # Copy and add to GitHub SSH settings
🚀 Step-by-Step Contribution Workflow
1️⃣Step 1: Find a GitHub Repository to Contribute To
Look for repositories with tags like good-first-issue, beginner, or
help-wanted
Read the [Link], [Link], and check open issues
2️⃣Step 2: Fork the Repository
Click the Fork button on the top-right of the repository page
This creates a copy of the repo under your GitHub username
3️⃣Step 3: Clone Your Fork Locally
git clone git@[Link]:your-username/[Link]
cd project-name
✅ Check remote:
git remote -v
4️⃣Step 4: Add Original Repository as Upstream
git remote add upstream git@[Link]:original-owner/[Link]
✅ Confirm:
git remote -v
5️⃣Step 5: Create a New Branch for Your Fix
git checkout -b feature/fix-typo
✅ Check branches:
git branch
6️⃣Step 6: Make Your Changes Locally
Edit code, fix bugs, add improvements
Save changes
7️⃣Step 7: Stage and Commit Your Changes
git add .
git status
✅ Then commit:
git commit -m "Fix: corrected typo in README"
8️⃣Step 8: Sync Your Branch With Latest Remote Code (Important!)
git fetch upstream
git merge upstream/main
✅ If conflicts appear:
git status
# Resolve them manually, then:
git add .
git commit -m "Resolve merge conflicts"
9️⃣Step 9: Push Your Changes to Your Fork
git push origin feature/fix-typo
🔟 Step 10: Create a Pull Request (PR)
Go to your fork on GitHub
Click “Compare & pull request”
Write a clear title and description of your change
Submit the PR to the main or correct branch of the original repo
⚠️Cautions and Best Practices
Tip Description
✅ One Feature = One Branch Keep each contribution in its own branch
Tip Description
🔄 Always Pull Before Pushing Use git fetch upstream + git merge
📄 Follow Contribution Always read the [Link]
Guidelines
✏️Use Clear Commit Example: Fix: correct alignment bug in
Messages navbar
🧹 Don’t Push to Main Always work in a separate branch
💬 Be Respectful in PRs Maintain clear and respectful
communication
🧪 Example: Fixing a Typo in a README
git clone git@[Link]:your-username/[Link]
cd some-project
git remote add upstream git@[Link]:original-owner/[Link]
git checkout -b fix/readme-typo
# edit [Link]
git add [Link]
git commit -m "Fix: corrected spelling mistake in README"
git fetch upstream
git merge upstream/main
git push origin fix/readme-typo
Then go to GitHub and open a Pull Request.
With this guide, you’re ready to confidently contribute to open
source projects the right way. Always read each repo’s specific rules
and guidelines before contributing!