title | description | keywords | author | manager | ms.date | ms.topic | ms.prod | ms.service | ms.technology | ms.assetid |
---|---|---|---|---|---|---|---|---|---|---|
Docs.microsoft.com contributor guide - Create/update an article in your local repo |
bryanla |
05/19/2016 |
article |
A269F1A3-CE8A-4F3F-A8FF-3FB44E276BB9 |
Follow the steps below to create a local working branch on your computer, which you can use to update or create a new article for docs.microsoft.com.
- Start Git Bash (or the command line tool you use for Git).
Note: If you are working in a private repository, add the "-pr" suffix to all commands using a repository name.
-
Switch context to your
<repository-name>
. Recall that this maps to a local working directory on your computer, under the pathc:\users\user-account\repository-name\
:cd <repository-name>:
-
Set the current working branch to the 'master' branch:
git checkout master
-
Pull down the latest changes for the 'master' branch in the docs.microsoft.com repository, and create a fresh local working branch derived from the master branch:
git pull upstream master:<working-branch>
-
Set the current working branch to the branch just created
git checkout <working-branch>
-
Push a copy of your working branch up to your fork:
git push origin <working-branch>
-
Create your new article or make changes to an existing article, by creating/modifying files in the local working directory (
c:\users\user-account\repository-name\
). Use Windows Explorer to open and create new markdown files, and use your markdown editor to edit them. -
As you create/modify/delete files in your working directory, you will want to "add" them to the staging area (aka: Index), then "commit" them from your working branch into your persisted copy of your branch, on a regular basis :
git add -A git commit –m "<comment>"
Or, to add only the specific files you modified:
git add <file path> git commit –m "<comment>"
-
Update your local working branch with changes from upstream on a regular basis (recall
upstream
points to the docs.microsoft.com repository), so you pick up all of the latest changes since your lastpull
:git pull upstream master
-
Push the changes to your fork on GitHub (recall
origin
points to your forked repository, a copy of the docs.microsoft.com repository):git push origin <working-branch>
-
When you are ready to submit your content to the
upstream
master branch for staging, validation, and/or publishing, go back to the GitHub UI for your fork, and create a Pull Request from your fork's working branch, to the docs.microsoft.com repository's master branch. Click the "New pull request" button, with your fork/branch on the right (from), and the docs.microsoft.com repo/branch on the left (to). The page will also show you a comparison of the branches, so you can validate that the Pull Request contains the changes you think it should contain. -
If you are an employee working in the private repository, a build report is sent to you via e-mail, and the changes you submit are automatically staged if the build completes successfully. Please review your staged content and indicate in the pull request comments whether you are signing off and ready for review/merge by the pull request reviewer. This indicates the changes are ready to be pushed live.
-
The pull request reviewer reviews your pull request, provides feedback, and/or merges your pull request.
-
Optionally verify your published article or changes at the appropriate
http://docs.microsoft.com/*path to-your-article-without-the-MD-extension*
URL.
Articles are published at approximately 10:00 AM and 3:30 PM Pacific Time, Monday-Friday. It can take up to 45 minutes for articles to appear online after publishing. Remember your pull request has to be merged by a pull request reviewer before the changes can be included in the next scheduled publishing run. You need to work with your pull request reviewer ahead of time to ensure a pull request is merged for a specific publishing run. Otherwise, PRs are reviewed in the order they were submitted.
If you are an employee working in the private repository, all pull requests are subject to validation rules that need to be addressed before the pull request can be merged.
If you need to work with a release branch that has been created by the release manager, the best way to create a local working branch from the release branch is to use this command syntax:
git checkout upstream/<release-branch-name> -b <local-working-branch-name>
This creates the local branch directly from the upstream branch, avoiding any local merging. The instructions for creating/updating/deleting content, pushing back to your fork, opening a Pull Request, etc., are the same as the instructions above for 'master' branch contributions, just use the release branch naming convention instead. When the release is ready, the release manager will merge the release branch into 'master'.
- If creating a new article, start with a copy of the docs.microsoft.com markdown template
- Back to the one-time Install and setup tools for authoring GitHub content locally
- Back to Step-by-step instructions in main Contributor Guide