DEV Community

Cover image for Quick Reference for Contributing to Open Source

Posted on

Quick Reference for Contributing to Open Source

Adapted from this Guide from DataSchool

Finding a Project

Setup Steps (Once Per Project)

  1. In GitHub, fork project repo

  2. From your personal repo, clone code

    git clone [URL]

  3. Verify your repo is the origin remote

    git remote -v

  4. Add project repo by cloning code

    git remote add upstream [URL]

Contribution Steps (Once Per Change)

  1. Pull latest project changes

    git pull upstream main

  2. Comment on issue requesting to be assigned (or assign yourself if allowed)

  3. Create new branch for your development

    git checkout -b [branch-name]

  4. Make changes, add, and commit; link PR to the issue by writing "Resolves #[issue-number]"

    • Be sure to follow any contributing guidelines or formatting specific to the project

    git add .
    git commit -m "Resolves #123; message here"

  5. Push to fork

    git push origin [branch-name]

  6. In GitHub, click 'Compare & Pull Request'

  7. Review details and click 'Create Pull Request'

Wait for comments/corrections or for project owner to approve the change

  1. After merge, delete branch from fork on GitHub and from local

    git checkout main
    git branch -D [branch-name]

  2. To sync fork with project, Pull latest changes from upstream to local

    git pull upstream main

  3. Push local to origin fork

    git push origin main

Top comments (0)