Contribute to open source

How to contribute to an Open Source Project

The contribution loop on GitHub, end to end: identify the repository, fork it, branch, commit, push to your fork, and open a pull request against the upstream project.

Here is a quick tip showing how to contribute to an open-source project.

Recently, we wanted to change how one of the features of an open-source plugin (sfdx-hardis) works. For this example, we will use a general GitHub repository as the target project. See what steps have to be performed to include your changes.

1. Identify the repository

Locate the repository of the project you want to contribute to, typically on GitHub. Read the repository's README and CONTRIBUTING.md files for guidelines on how to contribute.

2. Fork the repository

Create a personal copy of the repository by clicking the "Fork" button on the repository page, then clone the forked repository to your local machine.

bash
# Clone your forked repository
git clone https://github.com/your-username/project-name.git
cd project-name

3. Create a branch

Create a new branch for your changes to keep your work separate from the main branch.

bash
git checkout -b feature/your-feature-name

4. Make, commit and push your changes

Implement the changes required for your feature or fix. Use the tools and development environment recommended in the project documentation.

bash
# Make your changes and test them if possible
git add .
git commit -m "Description of the changes you made"

# Push changes to your fork
git push origin feature/your-feature-name

5. Create a pull request

Navigate to the original repository and create a pull request (PR) from your branch — yes, it will be visible there.

6. Respond to feedback

Maintain communication with the project maintainers. Address any feedback or requested changes to your PR promptly.

7. Finalize the contribution

Once approved, your changes will be merged into the main branch. Celebrate your contribution to the open-source community!

Transcribed by hand from the original slide. Plain-text version of the whole catalog