Workflow Overview
The standard contribution workflow:- Fork the Gutenberg repository
- Clone your forked repository
- Create a new branch
- Make code changes
- Confirm tests pass
- Commit your changes
- Push the branch to your fork
- Submit a pull request
Fork and Clone
Step 1: Fork the Repository
Go to github.com/WordPress/gutenberg and click the “Fork” button. This creates a copy of the repository under your account.Step 2: Clone Your Fork
Clone the forked repository to your local machine:Step 3: Add Upstream Remote
Add the main Gutenberg repository as the upstream remote:Branch Naming
Create descriptive branch names using this format:[type]/[description]
Branch Prefixes
add/- Add a new featuretry/- Experimental feature, tentatively addupdate/- Update an existing featureremove/- Remove an existing featurefix/- Fix an existing issue
Examples
Making Changes
Step 1: Create a Branch
Create a new branch fromtrunk:
Step 2: Make Code Changes
Make your changes following the Coding Guidelines.Step 3: Build and Test
Build the project and run tests:Step 4: Check Code Quality
Ensure code passes linting and formatting:Committing Changes
Writing Commit Messages
Write clear, descriptive commit messages following WordPress best practices:- Use present tense (“Add feature” not “Added feature”)
- Be descriptive but concise
- Focus on the “why” rather than the “what”
Staging and Committing
Pushing Changes
Push your branch to your forked repository:-u flag sets up tracking, so future pushes can use just git push.
Creating a Pull Request
Step 1: Open Pull Request
After pushing, GitHub will show a banner on your fork with a “Compare & pull request” button. Click it to create a pull request. Alternatively, go to the Gutenberg repository and click “New pull request”.Step 2: Fill Out PR Details
Provide a clear title and description: Title: Concise summary of the change Description:- What does this change do?
- Why is this change needed?
- How has it been tested?
- Screenshots (for UI changes)
- Related issues (use
Fixes #123orCloses #123)
Step 3: Review Checklist
Before submitting, ensure:- Tests pass (
npm test) - Code follows style guidelines
- No linting errors (
npm run lint:jsandnpm run lint:php) - Changes are documented (if needed)
- Accessibility has been tested (for UI changes)
Updating a Pull Request
If changes are requested:Make Additional Changes
Important Notes
- Don’t create a new PR for updates - the existing PR will update automatically
- Keep commits focused and atomic
- Respond to review comments
Keeping Your Branch Updated
Rebasing on Trunk
Keep your branch up to date with the main repository:- Keeps commit history clean and linear
- Avoids merge commits
- Makes it easier to review changes
Resolving Conflicts
If conflicts occur during rebase:- Git will pause and show conflicted files
- Open the files and resolve conflicts
- Stage the resolved files:
git add path/to/file - Continue rebasing:
git rebase --continue - Force push:
git push --force-with-lease
Keeping Your Fork Updated
Update Trunk Branch
Regularly sync your fork with upstream:Development Environment Commands
Setup
Development
Testing
Pull Request Best Practices
Keep PRs Focused
- One feature or fix per PR
- Avoid mixing unrelated changes
- Split large changes into smaller PRs
Ensure Build Passes
The CI system checks:- All tests pass
- No linting errors
- No formatting issues
Accessibility Testing
For UI changes, test with:- Keyboard navigation
- Screen readers
- High contrast mode
- Reduced motion preferences
React Native Compatibility
If changes affect function/class/variable names, update corresponding.native.js files to maintain React Native compatibility.
Getting Help
Where to Ask Questions
- Slack:
#core-editorand#core-jschannels on Make WordPress Slack - GitHub: Comment on issues or pull requests
- Make/Core: Make WordPress Core blog
Next Steps
- Review Testing Guide for testing requirements
- Check Common Pitfalls to avoid mistakes
- Read Architectural Decisions to understand design principles