Creating Branches

When you are working in Git, you can create branches.

How to Create Branches—Branch Management Dialog

  1. Do one of the following, depending on the part of the user interface you are using:
    • Ribbon Select Source Control > Branch.
    • Right-Click If you have the File List open, right-click on any file and select Source Control > Project > Branch.

    The Branch Management dialog opens.

  2. Click Create. The Create Branch dialog opens.
  3. From the Source Branch drop-down, select the existing branch you want to use to create the new branch. Your new branch will copy the existing files from the source branch, but commits you make on the new branch will not affect the source branch.
  4. In the Branch Name field, enter a name for your branch. Names cannot include spaces.
  5. (Optional) If you want to switch the branch when you create it, select the Switch to branch check box.

    Warning You will not see a confirmation message when switching to a newly created branch. Be sure all of your current changes are committed before creating and switching to a new branch. If you have uncommitted changes, they will be lost. See Committing Source Control Files—Git.

  6. Click Create. Your new branch is added to the "All branches" list. If you chose to switch to the branch, you can now begin working on the branch.

How to Create Branches—Source Control Explorer

  1. Select View > Source Control Explorer. The Source Control Explorer opens.
  2. From the drop-down or the Home pane, select Branches. The Branches view opens. In the pane, you can see your current branch, as well as lists of your published and unpublished branches.
  3. Click Create Branch. The Create Branch dialog opens.
  4. From the Source Branch drop-down, select the existing branch you want to use to create the new branch. Your new branch will copy the existing files from the source branch, but commits you make on the new branch will not affect the source branch.
  5. In the Branch Name field, enter a name for your branch. Names cannot include spaces.
  6. (Optional) If you want to switch the branch when you create it, select the Switch to branch check box.

    Warning You will not see a confirmation message when switching to a newly created branch. Be sure all of your current changes are committed before creating and switching to a new branch. If you have uncommitted changes, they will be lost. See Committing Source Control Files—Git.

  7. Click Create. Your new branch is added to the "All branches" list. If you chose to switch to the branch, you can now begin working on the branch.