Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Merge a

...

pull request (GitHub on the Web)

When you get approval for your changes from at least one doc team member ("thumbs up" sign by typing :+1: in the comment field) and one engineer/PM/other SME, you can merge your changes into the master branch for release. 

...

  1. Open Terminal on the Mac and change directories to the repo/branch for the PR for which you are squashing commits.
  2. Rebase against master before squashing commits:

    git status
    git fetch
    git rebase origin/master

    If you see "Current branch <branchname> is up to date", you're all set. If you see "Your branch and origin/<branchname> have diverged and have x and x different commits each, respectively", you should push your local changes. DO NOT follow the help and git pull.

    git push -f

    You should then see "Current branch <branchname> is up to date"


    Only from this state should you squash commits.


  3. Refresh your PR page in Github to make sure you are seeing the final number of commits made in that PR.

  4. Enter the command: 
    git rebase -i HEAD~3
    where the number after the tilde is the number of commits for your branch. A Sublime/text editor window opens.
  5. The top n lines in the file start with the word "pick", where n is that same number of commits. Skip the first line, and then change "pick" to "squash" or "s" on each subsequent line.
  6. Save the file. Another Sublime/text editor window opens.
  7. The descriptions you entered for each commit are listed at the top of the file. Delete all but one of them. Edit the description for the single commit to appropriately capture the changes you made in the PR as a whole. Save the file.
  8. Return to Terminal and enter the commands:
    git status
    git push -f
    The PR in Github will refresh to show only one commit, with the description that you chose in Step 6.

    Wait for final tests to run cleanly, then you can merge the PR.

Publish your documentation changes

Merging your changes adds them to the master branch for the project on Github, but does not publish them to the online help guides. Contact a doc team member to publish your changes so that they will be available in the relevant online guides. 

Links