Creating Branches
When you are working in Git, you can create branches.
[Menu Proxy — Headings — Online — Depth3 ]
How to Create Branches—Branch Management Dialog
- 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 Content Explorer, Project Organizer, Pending Changes window pane, or File List open, right-click on any file and select Source Control > Project > Branch.
The Branch Management dialog opens.
- Click Create. The Create Branch dialog opens.
- 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.
-
In the Branch Name field, enter a name for your branch. Names cannot include spaces.
Note Avoid creating new branches that share the same name as an existing branch but with different casing. It is best to creating an entirely unique name for each branch.
-
(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.
- 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
- Select View > Source Control Explorer. The Source Control Explorer opens.
- 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.
- Click Create Branch. The Create Branch dialog opens.
- 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.
- In the Branch Name field, enter a name for your branch. Names cannot include spaces.
-
(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.
- 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.