{"meta":{"title":"Quickstart for pull requests","intro":"Propose your first change and take it all the way from your first commit to a merged pull request.","product":"Pull requests","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/pull-requests","title":"Pull requests"},{"href":"/en/enterprise-cloud@latest/pull-requests/get-started","title":"Get started"},{"href":"/en/enterprise-cloud@latest/pull-requests/get-started/pull-request-quickstart","title":"Pull request quickstart"}],"documentType":"article"},"body":"# Quickstart for pull requests\n\nPropose your first change and take it all the way from your first commit to a merged pull request.\n\nA pull request proposes changes on a branch separate from the main code base so others can review the changes before they are merged. This quickstart walks you through the simplest path to a pull request. You'll create a branch, make and commit changes, open a pull request, respond to feedback, and merge.\n\nYou can follow along on the GitHub website or with GitHub CLI by selecting one of the tabs above.\n\n## Branch or fork the repository\n\nYou'll start by creating an isolated place to work.\n\n<div class=\"ghd-tool webui\">\n\n1. On GitHub, navigate to the main page of the repository you want to propose changes for.\n2. Optionally, if you don't have write access, you'll need a fork. Click **Fork** in the top-right corner and follow the steps. Then, continue in your fork of the repository.\n3. Click the branch selector menu at the top of the file list. It probably says **main**. Type a new branch name and click **Create branch *new-branch-name* from main**.\n\n</div>\n\n<div class=\"ghd-tool cli\"> \n\n1. To use GitHub CLI, you'll need to install it first. See [GitHub CLI quickstart](/en/enterprise-cloud@latest/github-cli/github-cli/quickstart).\n\n2. Clone the repository. Or, fork the repository and clone it locally at the same time.\n\n* If you have write access to the repository, clone the repository:\n\n  ```shell\n  gh repo clone OWNER/REPO\n  ```\n\n* If you don't have write access, you'll create a **fork** first and clone it all at once.\n\n  ```shell\n  gh repo fork OWNER/REPO --clone\n  ```\n\n1. Change to the cloned repository directory.\n\n   ```shell\n   cd REPO\n   ```\n\n2. Create and switch to a new branch.\n\n   ```shell\n   git checkout -b YOUR-BRANCH-NAME\n   ```\n\n</div>\n\n## Author or edit your code\n\nMake your changes on the branch. For your first pull request, keep the change focused and simple. Smaller pull requests are faster to review and easier to merge.\n\nTry one of the following to make your changes:\n\n* Edit files locally in your IDE or a text editor.\n* Edit a file directly on GitHub by browsing to it and clicking <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-pencil\" aria-label=\"Edit this file\" role=\"img\"><path d=\"M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z\"></path></svg>.\n\n## Commit frequently\n\nSave your work in small, meaningful commits. Each commit records a snapshot and a message describing the change.\n\n<div class=\"ghd-tool cli\">\n\n```shell\ngit add .\ngit commit -m \"Describe your change\"\ngit push --set-upstream origin YOUR-BRANCH-NAME\n```\n\n</div>\n\n<div class=\"ghd-tool webui\">\n\nWhen you edit a file on GitHub and are ready to commit, you'll enter a commit message and commit directly to your branch.\n\n1. Click **Commit changes...**.\n2. In the **Commit message** box, enter a short description of the changes you made.\n3. Select the branch you're working on.\n4. Click **Propose changes**.\n\nYour change will be added and committed to the branch.\n\n</div>\n\n## Open your pull request\n\nWhen your branch has the changes you want to propose, open a pull request against the base branch.\n\n<div class=\"ghd-tool webui\">\n\n1. On the main page of the repository, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-git-pull-request\" aria-label=\"The pull request icon\" role=\"img\"><path d=\"M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z\"></path></svg> Pull requests**, then click **New pull request**.\n2. For the **base** branch, main is probably already selected and is typically the base branch you'll merge into.\n3. For the **compare** branch, select the branch that contains your changes.\n4. Click **Create pull request**.\n5. Enter a title and a description that explains what you changed and why.\n6. You can create a pull request that's ready to review or one that's in a draft state.\n\n* If it's ready for review, click **Create pull request**.\n* To share a work in progress, use the dropdown and select **Create draft pull request**.\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\nYou can create a pull request that's ready to review or one that's in a draft state.\n\n* If it's ready for review:\n\n  ```shell\n  gh pr create\n  ```\n\n* To share a work in progress\n\n  ```shell\n  gh pr create --draft\n  ```\n\nThen, follow the prompts to set the base branch, title, and description.\n\n</div>\n\nIf you make further commits to the same branch, they will be automatically added to your pull request.\n\n## Request a review\n\nTo request a review via the **Reviewers** box, you need write access to the repository and you can request a review from a person or team with read access to the repository. If you request a review the person or team will receive a notification. In some cases, you'll see suggested reviewers that you can select from.\n\nIf the **Reviewers** box is unavailable to you, you can:\n\n* Check the readme for the repository for their guidance on pull request reviews and follow their instructions.\n* If you know a person who can do the review for you, reach out to them and share the link to your pull request.\n\n## Address review feedback\n\nReviewers may comment, suggest changes, or request changes before a pull request can be merged.\n\n* To accept a reviewer's suggestion, click **Commit suggestion** (or batch several and click **Commit suggestions**).\n* To make broader changes, edit your code and push new commits to the same branch. The pull request updates automatically and will re-run any checks.\n* Mark each conversation as **Resolved** once you've addressed it.\n\n## Merge and deploy\n\nOnce required reviews and status checks pass, merge the pull request to bring your changes into the base branch. If you decide not to merge the changes, you can close the pull request instead.\n\n> \\[!TIP]\n> Different repositories may have different requirements for merging. Review any relevant guidance and follow its instructions.\n\n<div class=\"ghd-tool webui\">\n\n1. At the bottom of the pull request, click **Merge pull request**.\n2. Click **Confirm** to complete the merge.\n3. (Optional) Delete the head branch to keep the repository tidy.\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n```shell\ngh pr merge\n```\n\nFollow the prompts to pick a merge method and optionally delete the branch.\n\n</div>\n\n## Next steps\n\nAfter your first pull request, try reviewing someone else's work. See [Quickstart for reviewing pull requests](/en/enterprise-cloud@latest/pull-requests/get-started/reviewing-pull-requests-quickstart).\n\n## Further reading\n\n* [Writing code for a project](/en/enterprise-cloud@latest/pull-requests/concepts/writing-code-for-a-project)\n* [Pull requests](/en/enterprise-cloud@latest/pull-requests/reference/pull-requests)"}