2020-04-06 17:47:40 +05:30
# How to open a Pull Request (PR)
2019-09-20 23:56:56 +05:30
2020-04-06 17:47:40 +05:30
A pull request enables you to send changes from your fork on GitHub to freeCodeCamp.org's main repository. Once you are done making changes to the code, or coding challenges you should follow these guidelines to send a PR.
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
## Prepare a good PR title
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
We recommend using [conventional title and messages ](https://www.conventionalcommits.org/ ) for commits and pull request. The convention has the following format:
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
> `<type>([optional scope(s)]): <description>`
>
> For example:
>
> `fix(learn): tests for the do...while loop challenge`
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
When opening a Pull Request(PR), you can use the below to determine the type, scope (optional) and description.
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
**Type:**
| Type | When to select |
| :---- | :--------------------------------------------------------------------------- |
| fix | Changed or updated/improved functionality, tests, verbiage of a lesson, etc. |
| feat | Only if you are adding new functionality, tests, etc. |
| chore | Changes that are not related to code, tests or verbiage of a lesson. |
| docs | Changes to `/docs` directory or the contributing guidelines, etc. |
**Scope:**
You can select a scope from [this list of labels ](https://github.com/freeCodeCamp/freeCodeCamp/labels?q=scope ).
**Description:**
Keep it short (less than 30 characters) and simple, you can add more information in the PR description box and comments.
Some examples of good PRs titles would be:
- `fix(a11y): improved search bar contrast`
- `feat: add more tests to html and css challenges`
- `fix(api,client): prevent CORS errors on form submission`
- `docs(i18n): Chinese translation of local setup`
## Proposing a Pull Request
2019-03-05 21:38:26 +05:30
1. Once the edits have been committed, you will be prompted to create a pull request on your fork's GitHub Page.
2020-04-06 17:47:40 +05:30

2019-03-05 21:38:26 +05:30
2. By default, all pull requests should be against the freeCodeCamp main repo, `master` branch.
2020-04-06 17:47:40 +05:30
Make sure that your Base Fork is set to freeCodeCamp/freeCodeCamp when raising a Pull Request.
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30

2019-03-05 21:38:26 +05:30
3. Submit the pull request from your branch to freeCodeCamp's `master` branch.
4. In the body of your PR include a more detailed summary of the changes you made and why.
2020-04-06 17:47:40 +05:30
- You will be presented with a pull request template. This is a checklist that you should have followed before opening the pull request.
- Fill in the details as you see fit. This information will be reviewed and the reviewers will decide whether or not your pull request is accepted.
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
- If the PR is meant to address an existing GitHub Issue then, at the end of
your PR's description body, use the keyword _Closes_ with the issue number to [automatically close that issue if the PR is accepted and merged ](https://help.github.com/en/articles/closing-issues-using-keywords ).
2019-03-05 21:38:26 +05:30
2020-04-06 17:47:40 +05:30
> Example: `Closes #123` will close issue 123
2019-03-05 21:38:26 +05:30
5. Indicate if you have tested on a local copy of the site or not.
2020-04-06 17:47:40 +05:30
This is very important when making changes that are not just edits to text content like documentation or a challenge description. Examples of changes that need local testing include JavaScript, CSS, or HTML which could change the functionality or layout of a page.