github.com/ld86/docker@v1.7.1-rc3/docs/project/create-pr.md (about)

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