github.com/xuyutom/docker@v1.6.0/docs/sources/project/create-pr.md (about) 1 page_title: Create a pull request (PR) 2 page_description: Basic workflow for Docker contributions 3 page_keywords: contribute, pull request, review, workflow, beginner, squash, commit 4 5 # Create a pull request (PR) 6 7 A pull request (PR) sends your changes to the Docker maintainers for review. You 8 create a pull request on GitHub. A pull request "pulls" changes from your forked 9 repository into the `docker/docker` repository. 10 11 You can see <a href="https://github.com/docker/docker/pulls" target="_blank">the 12 list of active pull requests to Docker</a> on GitHub. 13 14 ## Check Your Work 15 16 Before you create a pull request, check your work. 17 18 1. In a terminal window, go to the root of your `docker-fork` repository. 19 20 $ cd ~/repos/docker-fork 21 22 2. Checkout your feature branch. 23 24 $ git checkout 11038-fix-rhel-link 25 Already on '11038-fix-rhel-link' 26 27 3. Run the full test suite on your branch. 28 29 $ make test 30 31 All the tests should pass. If they don't, find out why and correct the 32 situation. 33 34 4. Optionally, if modified the documentation, build the documentation: 35 36 $ make docs 37 38 5. Commit and push any changes that result from your checks. 39 40 ## Rebase your branch 41 42 Always rebase and squash your commits before making a pull request. 43 44 1. Fetch any of the last minute changes from `docker/docker`. 45 46 $ git fetch upstream master 47 From github.com:docker/docker 48 * branch master -> FETCH_HEAD 49 50 3. Start an interactive rebase. 51 52 $ git rebase -i upstream/master 53 54 4. Rebase opens an editor with a list of commits. 55 56 pick 1a79f55 Tweak some of the other text for grammar 57 pick 53e4983 Fix a link 58 pick 3ce07bb Add a new line about RHEL 59 60 If you run into trouble, `git --rebase abort` removes any changes and gets 61 you back to where you started. 62 63 4. Squash the `pick` keyword with `squash` on all but the first commit. 64 65 pick 1a79f55 Tweak some of the other text for grammar 66 squash 53e4983 Fix a link 67 squash 3ce07bb Add a new line about RHEL 68 69 After closing the file, `git` opens your editor again to edit the commit 70 message. 71 72 5. Edit and save your commit message. 73 74 `git commit -s` 75 76 Make sure your message includes <a href="./set-up-git" target="_blank>your signature</a>. 77 78 8. Push any changes to your fork on GitHub. 79 80 $ git push origin 11038-fix-rhel-link 81 82 ## Create a PR on GitHub 83 84 You create and manage PRs on GitHub: 85 86 1. Open your browser to your fork on GitHub. 87 88 You should see the latest activity from your branch. 89 90 ![Latest commits](/project/images/latest_commits.png) 91 92 93 2. Click "Compare & pull request." 94 95 The system displays the pull request dialog. 96 97 ![PR dialog](/project/images/to_from_pr.png) 98 99 The pull request compares your changes to the `master` branch on the 100 `docker/docker` repository. 101 102 3. Edit the dialog's description and add a reference to the issue you are fixing. 103 104 GitHub helps you out by searching for the issue as you type. 105 106 ![Fixes issue](/project/images/fixes_num.png) 107 108 4. Scroll down and verify the PR contains the commits and changes you expect. 109 110 For example, is the file count correct? Are the changes in the files what 111 you expect. 112 113 ![Commits](/project/images/commits_expected.png) 114 115 5. Press "Create pull request". 116 117 The system creates the request and opens it for you in the `docker/docker` 118 repository. 119 120 ![Pull request made](/project/images/pull_request_made.png) 121 122 123 ## Where to go next 124 125 Congratulations, you've created your first pull request to Docker. The next 126 step is for you learn how to [participate in your PR's 127 review](/project/review-pr/).