Open source contribution

Stage 2 of 6 · 7 lessons · ~4 weeks

Git and GitHub for contributors

Contributing means working in a repository you do not own. Learn the fork and branch workflow, keeping a fork in sync with upstream, rebasing, and commits a reviewer can read.

Start: Everyday commands: status, diff, stash, log

Lessons· one lesson for each topic, in this order

  1. 1Everyday commands: status, diff, stash, log
  2. 2Forks, origin and upstream
  3. 3Feature branches
  4. 4Commit messages and Conventional Commits
  5. 5Keeping a branch up to date with rebase
  6. 6Resolving conflicts during a rebase
  7. 7Squashing and force-pushing safely

Start with

  • BookFree
    Pro Git

    Scott Chacon and Ben Straub

    Chapters 3, 5 and 6: branching, contributing to a project, and GitHub forks

Practise

  • The remote levels drill fetch, rebase and pushing while you watch the commit graph

Keep handy

Also worth your time

Before moving on: In a practice repository with an upstream remote, open a pull request from a branch, rebase it onto an updated upstream, resolve a conflict, and squash it into commits with clear messages.

Tauseef's advice
Learn a dozen commands properly rather than fifty badly: clone, status, diff --name-only, add, commit, stash, fetch, pull, push origin HEAD, branch --all, remote -v and log. Never work on your fork's main branch, and use --force-with-lease, never plain --force, on your own branches.

Mark this stage as not done?