2. Create a Branch

After you create a copy of the repository on your computer, you create a branch to work in privately until you are ready for your work to be reviewed and finally merged in to the public edX repository for release.

You can create a branch from the command line or by using GitHub Desktop.

We name branches according to the following format.

<your-name>/<JIRA ticket number or summary for a group of stories>

For example, your branch name might be pollyanna/DOC-1234 or pollyanna/FormattingUpdates.

Command Line

  1. At a command prompt, switch to the edx-documentation directory or any of its subdirectories.
  2. Type git checkout master, then git pull to make sure you have the latest version of master.
  3. Type git checkout -b <branch name>. The -b flag tells GitHub that this is a new branch.

To switch between branches at any time, type git checkout <branch name>

GitHub Desktop

  1. In the list of repositories, make sure you have selected the correct repository in which to create your branch.
  2. (optional but recommended) Switch to the branch on which you want to base your new branch (usually master, but in some cases another working branch), and click Sync. This ensures that you have the latest version before you create a branch off it.
  3. Click the branch plus icon to create a branch. 

  4. In the From field, specify the correct branch to base your new branch on. In most cases, this is master, but in some cases you will want to create your new branch off another branch.
  5. In the Name field, enter a name for the new branch according to the following format:
    <your-name>/doc/<story ID or a summary for a group of stories>
  6. Click Create Branch.
  7. Github Desktop refreshes; you are now on your new branch.
  8. The files that you now see in Finder on your computer are the ones in this branch.
  9. To switch between branches any time, select the branch to switch to from the dropdown list of branches.
  10. To switch to a branch on another repository, select the repository from the list of repositories and then select the branch.