github.com/jogo/docker@v1.7.0-rc1/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          Switched to branch '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. Checkout your feature branch in your local `docker-fork` repository.
    45  
    46      This is the branch associated with your request.
    47  
    48  2. Fetch any last minute changes from `docker/docker`.
    49  
    50          $ git fetch upstream master
    51          From github.com:docker/docker
    52           * branch            master     -> FETCH_HEAD
    53  
    54  3. Start an interactive rebase.
    55  
    56          $ git rebase -i upstream/master
    57  
    58  4. Rebase opens an editor with a list of commits.
    59  
    60          pick 1a79f55 Tweak some of the other text for grammar
    61          pick 53e4983 Fix a link
    62          pick 3ce07bb Add a new line about RHEL
    63  
    64  5. Replace the `pick` keyword with `squash` on all but the first commit.
    65  
    66          pick 1a79f55 Tweak some of the other text for grammar
    67          squash 53e4983 Fix a link
    68          squash 3ce07bb Add a new line about RHEL
    69  
    70      After you save the changes and quit from the editor, git starts
    71      the rebase, reporting the progress along the way. Sometimes
    72      your changes can conflict with the work of others. If git
    73      encounters a conflict, it stops the rebase, and prints guidance
    74      for how to correct the conflict.
    75  
    76  6. Edit and save your commit message.
    77  
    78  		`git commit -s`
    79  
    80      Make sure your message includes <a href="./set-up-git" target="_blank>your signature</a>.
    81  
    82  7. Force push any changes to your fork on GitHub.
    83  
    84          $ git push -f origin 11038-fix-rhel-link
    85          
    86  ## Create a PR on GitHub
    87  
    88  You create and manage PRs on GitHub:
    89  
    90  1. Open your browser to your fork on GitHub.
    91  
    92      You should see the latest activity from your branch.
    93  
    94      ![Latest commits](/project/images/latest_commits.png)
    95  
    96  
    97  2. Click "Compare & pull request."
    98  
    99      The system displays the pull request dialog. 
   100  
   101      ![PR dialog](/project/images/to_from_pr.png)
   102  
   103      The pull request compares your changes to the `master` branch on the
   104      `docker/docker` repository.
   105  
   106  3. Edit the dialog's description and add a reference to the issue you are fixing.
   107  
   108      GitHub helps you out by searching for the issue as you type.
   109  
   110      ![Fixes issue](/project/images/fixes_num.png)
   111  
   112  4. Scroll down and verify the PR contains the commits and changes you expect.
   113  
   114      For example, is the file count correct? Are the changes in the files what
   115      you expect?
   116  
   117      ![Commits](/project/images/commits_expected.png)
   118  
   119  5. Press "Create pull request".
   120  
   121      The system creates the request and opens it for you in the `docker/docker`
   122      repository.
   123  
   124      ![Pull request made](/project/images/pull_request_made.png)
   125  
   126  
   127  ## Where to go next
   128  
   129  Congratulations, you've created your first pull request to Docker. The next
   130  step is for you learn how to [participate in your PR's
   131  review](/project/review-pr/).