How to contribute to Gutenberg

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

  1. Head over to https://github.com/WordPress/gutenberg
  2. Create a personal fork, e.g. https://github.com/nielslange/gutenberg
  3. Clone the fork into the plugin folder on your local environment
    git clone https://github.com/nielslange/gutenberg.git
  4. Move into Gutenberg plugin folder
    cd gutenberg

Add an upstream

  1. Add upstream
    git remote add upstream https://github.com/WordPress/gutenberg.git
  2. Verify upstream
    git remote -v

Synch the fork

  1. Fetch upstream
    git fetch upstream
  2. Check out the master branch
    git checkout master
  3. Merge changes from the upstream/master into the local master branch
    git merge upstream/master

Contribute

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 master branch synched with the upstream branch. Thus, time to apply your own changes to the code.

Push changes and create pull request

  1. Push the local master branch
    git push
  2. Head over to your forked repository, e.g. https://github.com/nielslange/gutenberg/pulls, and click on New pull request.

Install dependencies and start watcher

  1. Open a terminal and browse to the Gutenberg plugin folder
  2. Install dependencies
    npm install
  3. Activate watcher
    npm run dev

Sources

3 Replies to “How to contribute to Gutenberg”

  1. Thanks for sharing this Niels! 🙂

    Reply

    1. 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.

      Reply

      1. Ditto! I recently learned the upstream part when contributing to Jetpack repo.

Leave a Reply