|
| 1 | +<properties |
| 2 | +pageTitle="Install and set up tools for authoring in GitHub" |
| 3 | +description="Tools and steps to get set up for authoring Azure content in GitHub." |
| 4 | +services="contributor-guide" |
| 5 | +documentationCenter="" |
| 6 | +authors="tysonn" |
| 7 | +manager="carolz" /> |
| 8 | + |
| 9 | +<tags |
| 10 | +ms.service="contributor-guide" |
| 11 | + ms.devlang="" |
| 12 | + ms.topic="article" |
| 13 | + ms.tgt_pltfrm="" |
| 14 | + ms.workload="" |
| 15 | + ms.date="01/19/2015" |
| 16 | + ms.author="tysonn" /> |
| 17 | + |
| 18 | +#Install and set up tools for authoring in GitHub |
| 19 | + |
| 20 | +Follow the steps in this article to set up tools for contributing to the Azure technical documentation. Casual and occasional contributors probably can use the GitHub UI described in step 2. |
| 21 | + |
| 22 | +If you're unfamiliar with Git, you might want to review some Git terminology: [https://help.github.com/articles/github-glossary](https://help.github.com/articles/github-glossary). In addition, this StackOverflow thread contains a glossary of Git terms you'll encounter in this set of steps: [http://stackoverflow.com/questions/7076164/terminology-used-by-git](http://stackoverflow.com/questions/7076164/terminology-used-by-git) |
| 23 | + |
| 24 | +## Contents |
| 25 | + |
| 26 | +- [Create a GitHub account and set up your profile](#create-a-github-account-and-set-up-your-profile) |
| 27 | +- [Sign up for Disqus](#sign-up-for-disqus) |
| 28 | +- [Determine whether you really need to follow the rest of these steps](#determine-whether-you-really-need-to-follow-the-rest-of-these-steps) |
| 29 | +- [Permissions in GitHub](#permissions-in-github) |
| 30 | +- [Install Git for Windows](#install-git-for-windows) |
| 31 | +- [Enable two-factor authentication](#enable-two-factor-authentication) |
| 32 | +- [Install a markdown editor](#install-a-markdown-editor) |
| 33 | +- [Configure Atom](#configure-atom) |
| 34 | +- [Fork the repository and copy it to your computer](#fork-the-repository-and-copy-it-to-your-computer) |
| 35 | +- [Configure your user name and email locally](#configure-your-user-name-and-email-locally) |
| 36 | +- [Next steps](#next-steps) |
| 37 | + |
| 38 | +## Create a GitHub account and set up your profile |
| 39 | + |
| 40 | +To contribute to the Azure technical content, you'll need a [GitHub](http://www.github.com) account. |
| 41 | + |
| 42 | +If you are a Microsoft contributor, you need to set up your GitHub account so you're clearly identified as a Microsoft employee. Set up your profile as follows: |
| 43 | + |
| 44 | +- **Profile picture**: a picture of you (required) |
| 45 | +- **Name**: your first and last name (required) |
| 46 | +- **Email**: your Microsoft email address (optional) |
| 47 | +- **Company**: Microsoft Corporation (required) |
| 48 | +- **Location**: list your location (optional) |
| 49 | + |
| 50 | +Your profile should resemble this profile: |
| 51 | + |
| 52 | +<p align="center"> |
| 53 | +  |
| 54 | + |
| 55 | +## Sign up for Disqus |
| 56 | + |
| 57 | +Every published Azure technical article has a comment stream provided by the Disqus service. |
| 58 | + |
| 59 | +  |
| 60 | + |
| 61 | +If you are a Microsoft employee, and if you are the author of or a contributor to an article, you need to sign up for Disqus so you can participate in the comment stream for the article. |
| 62 | + |
| 63 | +1. Sign up for an account at [http://www.disqus.com/](http://www.disqus.com/) |
| 64 | +2. Fill out your profile as follows: |
| 65 | + |
| 66 | + - **Full Name**: your full name as displayed in your Microsoft address book listing, plus the bracketed info, which is your alias plus @MSFT. Format: *First Last [alias@MSFT]* |
| 67 | + - **Location**: Your location |
| 68 | + - **Short Bio**: Your title |
| 69 | + |
| 70 | +## Determine whether you really need to follow the rest of these steps |
| 71 | + |
| 72 | +You might not need to follow all the steps in this article. It depends on the sort of content contribution you want or need to make. |
| 73 | + |
| 74 | +###Submit a text-only change to an existing article |
| 75 | + |
| 76 | +If you only need or want to make textual updates to an existing article, you probably don't need to follow the rest of the steps. You can use GitHub's web-based markdown editor to submit your changes. Just click the GitHub link in the article you want to modify: |
| 77 | + |
| 78 | +  |
| 79 | + |
| 80 | + Then, click the edit icon in the GitHub version of the article |
| 81 | + |
| 82 | +  |
| 83 | + |
| 84 | + That opens the easy-to-use web editor that makes it easy to submit changes. You don't need to follow the other steps in this article. |
| 85 | + |
| 86 | +###All other changes |
| 87 | +The GitHub UI does support creation of new files and dragging and dropping images. However, when you work in the UI, managing branches can be confusing so we typically recommend you install the tools and learn the commands for creating and managing articles. If you want to use the UI, see: |
| 88 | + |
| 89 | +- [Creating files on Github](https://github.com/blog/1327-creating-files-on-github) |
| 90 | +- [Upload files to your repositories](https://github.com/blog/2105-upload-files-to-your-repositories) |
| 91 | + |
| 92 | +For the following sorts of work, we strongly recommend you install and learn to use the tools: |
| 93 | + |
| 94 | + - Making major changes to an article |
| 95 | + - Creating and publishing a new article |
| 96 | + - Adding new images or updating images |
| 97 | + - Updating an article over a period of days without publishing changes each of those days |
| 98 | + - Creating content for a release that has to go out on a certain day at a certain time |
| 99 | + |
| 100 | +##Permissions in GitHub |
| 101 | + |
| 102 | +Anybody with a GitHub account can contribute to Azure technical content through our public repository at [https://github.com/Azure/azure-content](https://github.com/Azure/azure-content). No special permissions are required. |
| 103 | + |
| 104 | +If you are a Microsoft PM or writer who is working on Azure content, you must work in our private content repository, azure-content-pr. Visit [https://repos.opensource.microsoft.com ](https://repos.opensource.microsoft.com ) to request the read permissions that will let you make contributions through the private repo - sign in to GitHub using the button > click Azure > click **Join a team** or **Join another team**, and then search for and join the **azure-content-read** group. |
| 105 | + |
| 106 | +## Install Git for Windows |
| 107 | + |
| 108 | +Install Git for Windows from [http://git-scm.com/download/win](http://git-scm.com/download/win). This download installs the Git version control system, and it installs Git Bash, the command-line app that you will use to interact with your local Git repository. |
| 109 | + |
| 110 | +You can accept the default settings; if you want the commands to be available within the Windows command line, select the option that enables it. |
| 111 | + |
| 112 | +<p align="center"> |
| 113 | +  |
| 114 | + |
| 115 | +(Note: This is not the same as "Github for Windows". "Github for Windows" is a different GUI-based tool that will also work if you want to read up on yourself. [https://windows.github.com/](https://windows.github.com/)) |
| 116 | + |
| 117 | +## Enable two-factor authentication |
| 118 | + |
| 119 | +You have to enable two factor authentication (2FA) on your GitHub account if you are working in the private content repository. It's required in the private repository. |
| 120 | + |
| 121 | +To enable this, follow the instructions in both the following GitHub help topics: |
| 122 | + |
| 123 | +- [About Two-Factor Authentication](https://help.github.com/articles/about-two-factor-authentication/) |
| 124 | +- [Creating an access token for command-line use](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) |
| 125 | + |
| 126 | +When you create the token, select all the scopes available in the token-creation UI ([details on each scope](https://developer.github.com/v3/oauth/#scopes)) |
| 127 | + |
| 128 | +After you enable 2FA, you have to enter the access token instead of your GitHub password at the command prompt when you try to access a GitHub repository from the command line. The access token is not the authentication code that you get in a text message when you set up 2FA. It's a long string that looks something like this: fdd3b7d3d4f0d2bb2cd3d58dba54bd6bafcd8dee. A few notes about this: |
| 129 | + |
| 130 | +- When you create your access token, save it in a text file to make it readily accessible when you need it. |
| 131 | + |
| 132 | +- Later, when you need to paste the token, know there are two ways to paste in the command line: |
| 133 | + |
| 134 | + - Click the icon in the upper left corner of the command line window>Edit>Paste. |
| 135 | + - Right-click the icon in the upper left corner of the window and click Properties>Options>QuickEdit Mode. This configures the command line so you can paste by right-clicking in the command line window. |
| 136 | + |
| 137 | +## Install a markdown editor |
| 138 | + |
| 139 | +We author content using simple "markdown" notation in the files, rather than complex "markup" (HTML, XML, etc.). So, you'll need to install a markdown editor. |
| 140 | + |
| 141 | +- **Atom**: Most of us use GitHub's Atom markdown editor: [http://atom.io](http://atom.io). It does not require a license for business use. It has spell check. |
| 142 | + |
| 143 | +- **Notepad**: You can use Notepad for a very lightweight option. |
| 144 | + |
| 145 | +- **Prose**: This is a lightweight, elegant, on-line, and open source markdown editor that offers a preview. Visit [http://prose.io](http://prose.io) and authorize Prose in your repository. |
| 146 | + |
| 147 | +- **[Visual Studio Code](https://www.visualstudio.com/products/code-vs.aspx)** - Microsoft's entry in this space. |
| 148 | + |
| 149 | +## Configure Atom |
| 150 | + |
| 151 | +If you use Atom, you'll need to set a few things up. |
| 152 | + |
| 153 | +- Atom defaults to using 2 spaces for tabs, but Markdown expects 4 spaces. If you leave it at the default of two, your article will look great in local preview, but not when it’s imported into Azure. So, configure Atom to use 4 spaces - you can find this setting under File>Settings>Editor Settings>Tab Length. |
| 154 | +- You will probably also want to turn on Soft Wrap in this section too, which does the same as "word wrap" in Notepad. |
| 155 | +- To turn on the markdown preview, click Packages>Markdown Preview>Toggle Preview. You can use Ctrl-Shift-M to toggle the preview HTML view. |
| 156 | + |
| 157 | +## Fork the repository and copy it to your computer |
| 158 | + |
| 159 | +1. Create a fork of the repository in GitHub - go to the top-right of the page and click the Fork button. If prompted, select your account as the location where the fork should be created. This creates a copy of the repository within your Git Hub account. Generally speaking, technical writers and program managers need to fork azure-content-pr, the private repo. Community contributors need to fork azure-content, the public repo. You only need to fork one time; after your first setup, if you want to copy your fork to another computer, you only have to run the commands that follow in this section to copy the repo to your computer. If you choose to create forks of both repositories, you will need to create a fork for each repository. |
| 160 | + |
| 161 | +2. Copy the Personal Access Token that you got from [https://github.com/settings/tokens](https://github.com/settings/tokens). You can accept the default permissions for the token. Save the Personal Access Token in a text file for later reuse. |
| 162 | + |
| 163 | +3. Next, copy the repository to your computer with your credentials embedded in the command string. To do this, open Git Bash and run it as an administrator. At the command prompt, enter the following command. This command creates a azure-content(-pr) directory on your computer. If you're using the default location, it will be at c:\users<your Windows user name>\azure-content(-pr). |
| 164 | + |
| 165 | +Public repo: |
| 166 | + |
| 167 | + git clone https://[your GitHub user name]:[token]@github.com/<your GitHub user name>/azure-content.git |
| 168 | + |
| 169 | +Private repo: |
| 170 | + |
| 171 | + git clone https://[your GitHub user name]:[token]@github.com/<your GitHub user name>/azure-content-pr.git |
| 172 | + |
| 173 | +For example, this clone command could look something like this: |
| 174 | + |
| 175 | + git clone https://smithj:b428654321d613773d423ef2f173ddf4a312345@github.com/smithj/azure-content-pr.git |
| 176 | + |
| 177 | +## Set remote repository connection and configure credentials |
| 178 | + |
| 179 | +Create a reference to the root repository by entering these commands. This sets up connections to the repository in GitHub so that you can get the latest changes onto your local machine and push your changes back to GitHub. This command also configures your token locally so that you don't have to enter your name and password each time you try to access the upstream repo and your fork on GitHub. |
| 180 | + |
| 181 | +Public repo: |
| 182 | + |
| 183 | + cd azure-content |
| 184 | + git remote add upstream https://[your GitHub user name]:[token]@github.com/Azure/azure-content.git |
| 185 | + git fetch upstream |
| 186 | + |
| 187 | +Private repo: |
| 188 | + |
| 189 | + cd azure-content-pr |
| 190 | + git remote add upstream https://[your GitHub user name]:[token]@github.com/Azure/azure-content-pr.git |
| 191 | + git fetch upstream |
| 192 | + |
| 193 | +This usually takes a while. After you do this, you won't have to fork again or enter your credentials again. You would only have to copy the forks to a local computer again if you set the tools up on another computer. |
| 194 | + |
| 195 | + |
| 196 | +## Configure your user name and email locally |
| 197 | + |
| 198 | +To ensure you are listed correctly as a contributor, you need to configure your user name and email locally in Git. |
| 199 | + |
| 200 | +1. Start Git Bash, and switch into azure-content or azure-content-pr: |
| 201 | + |
| 202 | + ```` |
| 203 | + cd azure-content |
| 204 | + ```` |
| 205 | + |
| 206 | + or |
| 207 | + |
| 208 | + ```` |
| 209 | + cd azure-content-pr |
| 210 | + ```` |
| 211 | + |
| 212 | +2. Configure your user name so it matches your name as you set it up in your GitHub profile: |
| 213 | + |
| 214 | + ```` |
| 215 | + git config --global user.name "John Doe" |
| 216 | + ```` |
| 217 | +3. Configure your email so it matches the primary email designated in your GitHub profile; if you're a MSFT employee, it should be your MSFT email address: |
| 218 | +
|
| 219 | + ```` |
| 220 | + git config --global user.email "alias@example.com" |
| 221 | + ```` |
| 222 | +4. Type `git config -l` and review your local settings to ensure the user name and email in the configuration are correct. |
| 223 | +
|
| 224 | +##Next steps |
| 225 | +
|
| 226 | +- Understand the type of content that belongs in the technical content repo, and know what does not belong. See the [content channel guidance](./content-channel-guidance.md)! |
| 227 | +- Follow [these steps to create or modify an article and then submit it for publishing](./git-commands-for-master.md). |
| 228 | +- Copy [the markdown template](../markdown templates/markdown-template-for-new-articles.md) as the basis for a new article. |
| 229 | +- Use [this checklist to verify your pull request will meet the quality criteria](./contributor-guide-pr-criteria.md) for merging. |
| 230 | +
|
| 231 | +
|
| 232 | +###Contributors' guide navigation |
| 233 | +
|
| 234 | +- [Overview article](./../README.md) |
| 235 | +- [Index of guidance articles](./contributor-guide-index.md) |
| 236 | +
|
| 237 | +
|
| 238 | +
|
| 239 | +<!--Anchors--> |
| 240 | +[Use a customer-friendly voice]: #use-a-customer-friendly-voice |
| 241 | +[Consider localization and machine translation]: #consider-localization-and-machine-translation |
| 242 | +[other style and voice issues to watch for]: #other-style-and-voice-issues-to-watch-for |
| 243 | +
|
| 244 | +
|
| 245 | +[Create a GitHub account and set up your profile]: #create-a-github-account-and-set-up-your-profile |
| 246 | +[Determine whether you really need to follow the rest of these steps]: #determine-whether-you-really-need-to-follow-the-rest-of-these-steps |
| 247 | +[Permissions in GitHub]: #permissions-in-github |
| 248 | +[Install Git for Windows]: #install-git-for-windows |
| 249 | +[Enable two-factor authentication]: #enable-two-factor-authentication |
| 250 | +[Install a markdown editor]: #install-a-markdown-editor |
| 251 | +[Fork the repository and copy it to your computer]: #fork-the-repository-and-copy-it-to-your-computer |
| 252 | +[Install git-credential-winstore]: #install-git-credential-winstore |
| 253 | +[Sign up for Disqus]: #sign-up-for-disqus |
| 254 | +[Configure your user name and email locally]: #configure-your-user-name-and-email-locally |
| 255 | +[Next steps]: #next-steps |
0 commit comments