-
Notifications
You must be signed in to change notification settings - Fork 143
Contribution guide
Note: This guide is primarily intended to instruct designers on proper GitHub usage.
All of PatternFly.org’s current content lives in the “main” PatternFly branch.

This branch is the source of truth that contains all published on PatternFly.org. When you create a PR, you will need to create your own branch, off of the main branch. This is you will be able to make your edits. When you create a pull request, you are essentially asking the system to pull the content you created from your branch into “main”.
-
Open VS Code and open the
patternfly-org
folder that you created in your setup process. -
Open a new terminal within VS Code:
-
In your terminal (should open at the bottom of VS Code), enter these commands to make sure you have the latest version of the main branch:
- First, type
git status
. This will display the branch you are on. - If you’re not on branch main, type
git checkout main
You can typegit status
at any point to figure out where you are. - Once you’re on the main branch, type
git fetch upstream
. This fetches the latest changes from the main branch. - Type
git merge upstream/main
to merge the latest changes to your local branch. - Then type
git push
to complete the merge.-
You could get the following popup after typing
git push
. If so, click Allow.-
Then click Authorize Visual-Studio-Code if/when prompted.
-
-
You could also get the following prompt:
Username for https://github.com:
- If so, type in your GitHub username, then press Enter.
- In the following field, DO NOT type in your regular GitHub account password. Instead, create a token by following GitHub's instructions.
- At step 7, set it to never expire.
- At step 8, check all the fields.
- Once you have your personal access token code, copy it and paste it in the password field back in the VS Code terminal. Then press Enter.
- WARNING! The password field will not show anything while you type, so make sure you are careful/paying attention. Just because nothing is showing up does not mean it did not go through.
-
Here's what successfully updating your main branch looks like:
- First, type
Once you're sure that your main branch is updated, you can create a new branch for the issue you're working on.
- Type
git checkout -b [name of your branch]
and press Enter.- For example, if you’re working on GitHub issue 2020, you would type
git checkout -b iss2020
, to align your branch name with the issue number.
- For example, if you’re working on GitHub issue 2020, you would type
- Edit files in VS Code, by referring to Step 7. Your changes should auto save based on your first-time setup. To check that your changes are saving, you can type
git status
at any point.
If you're working on updating a PR that you've already opened:
-
Navigate your VS Code terminal to the right folder. Follow bullets 1 and 2 of creating a new PR if you need help.
-
Not sure what your original branch was? You can find it beneath the title of of your GitHub PR:
-
-
Navigate to the PR branch by typing
git checkout [name of your branch]
.- For example, if your branch name is “iss2020”, you would type
git checkout iss2020
.
- For example, if your branch name is “iss2020”, you would type
-
Edit files in VS Code. Continue to Step 9 to commit your changes.
Whether you're creating new content or making updates to existing content, follow our separate PatternFly.org writing guide.
Once you’re finished making changes, stage them in VS Code:
-
Click on the numbered bubble in the left toolbar’s code icon.
-
In the Changes tab, right-click and select Stage all changes.
- Go to your terminal at the bottom of VS Code to commit the changes:
- Type
git status
and press Enter. This should list the same files that were listed in your “changes” tab in VSC. If there aren’t any errors, continue to the next step. - Type
git commit -m ‘docs(component): PR title’
and press Enter.- For example, if you are creating a PR to make edits to the table component design guidelines, you could type
git commit -m ‘docs(table): Updates design guidelines’.
- Make sure to use single quotation marks (‘). You can edit this title later in GitHub if necessary.
- For example, if you are creating a PR to make edits to the table component design guidelines, you could type
If your commit goes through without issue, you can ignore this and continue to the next step.
If this is your first time creating a PR, you may get one of these 2 errors when submitting this command:
-
"Author identity unknown"
To resolve this:
- Type
git config --global user.email “[email protected]”
, and press Enter. Replace [email protected] with the email you used to create your GitHub account. - Then type
git config --global user.name “Your name”
, and press Enter. Replace your name with your GitHub username.
- Type
-
"fatal: unable to auto-detect email address (got ‘_____’)."
Do not panic, this just means you need to log into your GitHub account within the terminal. To resolve this:
- Follow the steps in step 1.
- Once you get the issue sorted, type in the commit command that initially gave you the failure/issue again and continue to the next step.
- FINAL STEP! Type
git push origin [name of your branch]
and press Enter.- For example
git push origin iss1234
.
- For example
Navigate to GitHub to finish creating your PR.
-
Go to the patternfly-org repo pulls tab and click Compare & pull request in the yellow alert:
-
On the resulting page, make sure that the arrow points towards the base repository and away from the head repository.
-
Change your PR title if you need to, to describe what the issue was.
-
Update the description with the words “closes #issuenumber”. For example, if the design doc issue you’re addressing is issue 1234, you would comment “closes #1234”. When you type in the number, the list of issues should pop up - so you can just click the issue from there!
- Doing this automatically close the original design doc issue when the PR is merged.
-
Tag edonehoo to initiate a final review.
-
Submit the PR.
- Once you submit your PR, a preview link will be generated by patternfly-build after all checks have passed. This loads your drafted content onto the PatternFly website, for a better visual of the pending changes:
Now that you’ve created your PR, and have it up for review, your reviewer will take a look at your PR and either:
- Approve it, and merge it if everything looks good. If this is your case, then congrats! You’re done!
- Leave comments on it for you to address. If this is your case, you will have to go back into VS Code and edit your PR. You can find review comments on the main PR page, if you scroll down.
To update your PR based on feedback:
- In VS Code, navigate to your PR branch (git checkout [branchname]) Make your edits
- Follow the steps to stage and commit your edits.
- Once you commit and push your changes, a new line will appear in your PR page, showing that you’ve pushed something new/made changes to your PR. (You will not see a green button again to “create a pull request” since you’ve already created one. You are simply adding to an existing one in this case.)
- Ping your reviewer again to let them know that you’ve made updates and that they should do another review.
- Upon merging the pull request, new content will become live on the website in the next release.
Note: If your PR has merge conflicts in GitHub, reach out to Erin Donehoo (edonehoo) for help.
If you have any other questions, reach out to the PatternFly team via the list-patternfly Slack channel.