2026 Edition
Every command, then your first real PR

Git & GitHub
Contributor's
Playbook

Every Git command you'll actually use, explained — then the complete path to finding a project, understanding a codebase, and getting your first pull request merged into a real open source repo.

"Your first merged pull request teaches you more about real-world engineering than six months of solo tutorials. Open source is the only 'job' where you can start today, with zero interviews, and the commit history is the resume."
— The Boring Education Team
40+
Git commands covered
6
Steps to your first PR
150M+
Repos on GitHub
1
Weekend to your first merge

Git Basics — The Commands You'll Type Every Single Day

1
Setup & Config
Tell Git Who You Are — Before Anything Else
Run this once per machine before your first commit anywhere, so every commit is correctly attributed to you. Use --global to set it for every repo on your machine, or drop the flag inside a specific repo to override it for that project only (useful for keeping work and personal commits separate).
Run once Identity
2
Starting a Repository
Init a New Repo, or Clone an Existing One
git init turns any folder into a Git repository, tracked from that point forward. git clone copies a full remote repository — history, branches, and all — onto your machine, and automatically wires it up as the origin remote so you can push and pull immediately.
Non-negotiable Day one commands
3
The Staging Cycle
Stage, Check, and Commit — the Loop You Repeat Constantly
git status shows what's changed, staged, or untracked — run it constantly, it's free and it prevents mistakes. git add stages files for the next commit; use git add . to stage everything in the current directory, or add files individually when you want a cleaner, more intentional commit. git commit saves the staged snapshot with a message describing what changed and why.
Used constantly Core workflow
4
Inspecting History
Reading What Actually Happened — Diff & Log
git diff shows exact line-by-line changes before you stage them — always read this before committing, it catches accidental debug code and leftover console logs. git log shows commit history; add --oneline --graph for a compact, visual view of branches and merges that's far easier to scan than the default verbose output.
Read before you commit History
💡
Write commit messages for the next person reading your history, not for right now. "fixed stuff" tells nobody anything six months later. Use the format type: short description — e.g. fix: handle null user on login or feat: add pagination to search results. This single habit makes code review and debugging dramatically faster for everyone on the project, including future-you.

Branching, Remotes & the Push/Pull Cycle

5
Branching
Never Work Directly on main
Every change — a feature, a fix, an experiment — gets its own branch, keeping main always deployable and clean. git switch -c (or the older git checkout -b) creates and switches to a new branch in one step. Name branches descriptively: fix/login-redirect or feat/dark-mode, not branch1.
Golden rule Branching
6
Merging
Bringing Branches Back Together
git merge combines the history of another branch into your current one — usually run on main to bring in a finished feature branch. Merge conflicts happen when the same lines were changed on both sides; Git marks the conflicting sections directly in the file for you to resolve manually, then you stage and commit the resolution.
Combining work Conflict resolution
7
Remotes
Syncing Your Local Repo With GitHub
git push uploads your committed local changes to the remote repository; git pull downloads and merges the latest remote changes into your current branch (it's actually fetch + merge combined). git fetch alone downloads changes without merging — safer when you want to review what changed before integrating it.
Sync commands Remote workflow
8
Undoing Things
Everyone Makes Mistakes — Here's How to Undo Them
git stash temporarily shelves uncommitted changes so you can switch branches cleanly, then git stash pop brings them back. git reset moves your branch pointer backward (use --soft to keep changes staged, --hard to discard them entirely — be careful). git revert is the safe option for shared branches: it creates a new commit that undoes a previous one, without rewriting history.
Safety net Undo commands

⚠️
Never use git reset --hard or force-push on a shared branch. --hard permanently discards uncommitted work with no undo. git push --force overwrites remote history and can erase a teammate's commits. If you must force-push your own feature branch after a rebase, use git push --force-with-lease instead — it refuses to overwrite work you haven't seen yet.
Command What It Does When to Use It
git status Shows staged, unstaged, and untracked changes Constantly, before every add/commit
git log --oneline Compact commit history Reviewing what's been done on a branch
git switch -c Create + move to a new branch Starting any new feature or fix
git pull --rebase Replay your commits on top of latest remote Keeping a clean, linear history

Advanced Git — Rebase, Cherry-Pick & Recovery

9
Rebasing
A Cleaner Alternative to Merge Commits
git rebase replays your branch's commits on top of another branch's latest history, producing a clean, linear timeline instead of a merge-commit web. git rebase -i (interactive) lets you reorder, edit, squash, or drop commits before opening a pull request — most maintainers prefer a tidy, squashed commit history over a dozen "wip" commits.
Clean history PR hygiene
10
Cherry-Picking & Tags
Grabbing One Commit, Marking a Release
git cherry-pick applies a single specific commit from another branch onto your current one — useful for backporting a fix without merging an entire branch. git tag marks a specific commit as a named release point (e.g. v1.2.0), which most projects use to track version history and generate changelogs.
Selective merging Releases
11
The Panic-Button Command
git reflog — Your Undo History for Undo Commands
Accidentally deleted a branch or reset too far back? git reflog logs every place HEAD has pointed to, even commits that look "lost" after a hard reset. Find the commit hash you need in the reflog, then git reset --hard <hash> or git checkout <hash> to recover it. Almost nothing in Git is truly gone until garbage collection runs.
Recovery Know this exists

Stop Committing Files That Don't Belong in History
🟥 Dependencies
node_modules/
venv/ or .venv/
vendor/
🟧 Secrets & config
.env / .env.local
*.pem / *.key
config/secrets.yml
🟩 Build & OS junk
dist/ / build/
.DS_Store
*.log
🔑
Already committed a secret by accident? Adding it to .gitignore afterward doesn't remove it from history — anyone can still find it in an old commit. Rotate the leaked credential immediately, then use a tool like git filter-repo or BFG Repo-Cleaner to scrub it from history if it's genuinely sensitive.

Why Contribute, and How to Find the Right First Project

1
Why It Matters
Open Source Is the Fastest Way to Practice Real Engineering
Tutorials teach syntax; open source teaches you how real production codebases are structured, reviewed, and maintained by teams you've never met. It builds a public portfolio that outlasts any single job, gives you direct exposure to senior engineers' code review feedback for free, and is one of the strongest signals recruiters look for on a resume with limited work experience.
Public portfolio Free mentorship
2
Finding Beginner-Friendly Issues
Look for the Labels That Signal "Start Here"
Search GitHub for issues labeled good first issue, help wanted, or beginner-friendly — maintainers tag these specifically for newcomers, and they're usually scoped small enough to finish in a few hours. Use GitHub's own search filters (is:issue is:open label:"good first issue") combined with a language filter to match your skill set.
Look for labels Scope matters
3
Pick the Right Project
Not Every Popular Repo Is a Good Starting Point
Prioritize projects you already use or genuinely find interesting — motivation matters more than star count. Check the project's activity: recent commits, responsive maintainers on issues, and an active PR review cadence are better signals than raw popularity. A huge, slow-moving repo with maintainers who haven't replied to an issue in months is a frustrating first experience.
Check activity, not just stars Pick something you use
4
Read Before You Write Any Code
CONTRIBUTING.md Is Not Optional
Almost every serious open source project has a CONTRIBUTING.md file outlining exact expectations: coding style, branch naming, commit conventions, how to run tests locally, and the PR review process. Skipping this is the single most common reason first-time PRs get rejected or sent back with change requests — read it fully before opening your editor.
Read this first Prevents rejected PRs

🎯
Start with documentation, not code. Fixing a typo, clarifying a confusing setup step, or improving a README is a genuinely valuable, low-risk first contribution. It teaches you the entire PR workflow — fork, branch, commit, push, open PR, respond to review — without the pressure of shipping a feature on your very first attempt.

Fork → Branch → Commit → PR → Review → Merge

5
Step 1 · Fork & Clone
Get Your Own Copy to Work In
Since you don't have direct write access to most projects, click "Fork" on GitHub to create your own copy under your account, then clone your fork locally — not the original repo. Add the original as an upstream remote so you can pull in the latest changes from the real project as it evolves while you work.
Your own sandbox Fork workflow
6
Step 2 · Branch & Build
One Branch Per Fix — Test It Locally First
Create a clearly named branch off the latest main, and run the project's existing test suite before you touch anything, to confirm you're starting from a working baseline. Make focused, minimal changes — a PR that fixes one issue is far easier to review and merge than one that also refactors unrelated code "while you're in there."
Keep PRs focused Test before and after
7
Step 3 · Commit & Push
Clean Commits, Then Push to Your Fork
Follow the project's commit message convention if one exists (many use Conventional Commits: fix:, feat:, docs:). Squash noisy work-in-progress commits into one clean commit with git rebase -i before pushing, then push the branch to your fork, not the original repository.
Squash before pushing Push to your fork
8
Step 4 · Open the Pull Request
Write a PR Description That Respects the Reviewer's Time
Reference the issue number (e.g. Closes #123) so GitHub links and auto-closes it on merge. Explain what changed, why, and how you tested it — screenshots or short clips for UI changes are especially appreciated. Expect review comments; treat them as collaboration, not rejection, and respond to every comment even if just to confirm a change was made.
Link the issue Expect review rounds

🔄
Keep your fork in sync as review drags on. Long-lived PRs often need a rebase before merge if main moved forward. Regularly git fetch upstream && git rebase upstream/main on your branch keeps conflicts small and manageable instead of one giant merge fight at the end.
Prefix Used For Example
feat: A new feature or capability feat: add dark mode toggle
fix: A bug fix fix: prevent crash on empty input
docs: Documentation-only changes docs: clarify install steps in README
chore: Maintenance, deps, config chore: bump eslint to v9

Platforms to Find Projects, and Community Etiquette

🎯 Good First Issue (goodfirstissue.dev)
Aggregates beginner-friendly issues across GitHub by language and topic. The single fastest way to find a scoped, approachable task without manually searching dozens of repos.
🌱 Up For Grabs
A curated list of projects that actively maintain "up for grabs" style labels for newcomers, across nearly every language and framework.
🧑‍🤝‍🧑 First Timers Only
Specifically targets people who have literally never contributed to open source before — extra patient maintainers and very low-stakes issues by design.
📬 CodeTriage
Emails you a small batch of open issues from projects you subscribe to, so you build a steady contribution habit without constantly searching manually.
🎃 Hacktoberfest
Annual event every October where thousands of projects welcome new contributors, with extra guidance, swag, and lower-pressure onboarding for first-timers.
🔍 GitHub Explore & Topics
Browse github.com/topics and github.com/trending filtered by your language to discover active projects you might genuinely want to use and improve.

Comment on the issue and wait to be assigned before starting work — avoids duplicate effort with another contributor
Ask clarifying questions on the issue itself rather than guessing silently for hours
Keep pull requests small and focused on exactly one issue — never bundle unrelated changes
Be patient with review turnaround — most maintainers are volunteers reviewing in their spare time
Say thank you, even on a closed or rejected PR — maintainers remember contributors who handle feedback gracefully
🗓️
Consistency beats intensity. One small, well-reviewed PR every week for three months builds a far stronger open source profile than a single large contribution followed by months of silence. Maintainers and future employers both notice a steady commit history more than a single impressive-looking spike.

Best Free YouTube Channels for Git, GitHub & Open Source

📺 freeCodeCamp
Full-length Git and GitHub courses covering everything from first commit to advanced rebasing, plus dedicated open source contribution walkthroughs for beginners.
📺 The Coding Train
Approachable, friendly explanations of Git fundamentals and a dedicated series specifically on making your first open source contribution.
📺 Fireship
Fast, dense explainers on Git internals, GitHub features, and workflow tricks — perfect for quickly filling specific knowledge gaps.
📺 GitHub (Official Channel)
Straight from the source — feature walkthroughs, GitHub Actions, GitHub CLI, and official guidance on maintaining and contributing to projects.
📺 Tech With Tim
Clear, practical Git tutorials and a specific "how to contribute to open source as a beginner" series that mirrors this guide's workflow.
📺 Codevolution
In-depth Git and GitHub playlists covering branching strategies, rebasing, and collaborative workflows used in real engineering teams.

Tech Yatra — Learning roadmaps Resume Yatra — ATS-ready resume Community — Find contribution buddies DSA Yatra — Daily practice Prep Yatra — Interview tracker Shiksha — Free courses
Your First Commit Is One Weekend Away 🌱
Every maintainer you'll ever look up to started with a typo fix in someone else's README.
Pick one issue, open one PR, and start today.
→ theboringeducation.com