Contributing to an open source project can be fun. But how to get started? The following simple steps should get you up and running and empower you to contribute to open source projects on Github.
Fork and clone the original repository
- Head over to https://github.com/WordPress/gutenberg
- Create a personal fork, e.g. https://github.com/nielslange/gutenberg
- Clone the fork into the plugin folder on your local environment
- Move into Gutenberg plugin folder
Add an upstream
- Add upstream
- Verify upstream
Synch the fork
- Fetch upstream
- Check out the trunk branch
- Merge changes from the upstream/trunk into the local trunk branch
Now, you should have a fork of the original repository added to your GitHub profile as well as having the upstream defined and your local trunk branch synched with the upstream branch. Thus, time to apply your changes to the code.
Push changes and create pull request
- Push the local trunk branch
- Head over to your forked repository and click on
New pull request.
Install dependencies and start watcher
- Open a terminal and browse to the Gutenberg plugin folder
- Install dependencies
- Activate watcher
Where you read “master” in the GIT commands, change it to “trunk”. WordPress made this change some time ago.
Good catch, Marcio. I’ve updated the post accordingly.
Thanks for sharing this Niels! 🙂
You’re very welcome! I remember that months ago I struggled with this and received great help from a friend. Especially the upstream part wasn’t obvious to me initially.
Ditto! I recently learned the upstream part when contributing to Jetpack repo.