Partilhar via


View the branch hierarchy of a project

TFS 2018

Visual Studio 2019 | Visual Studio 2022

As a project grows, its branch structure typically also grows and becomes more complex. You and your team members might need answers to the following questions:

  • What branches are in the project?
  • How are these branches related to each other?
  • Who owns the various branches?
  • If changes are needed from a feature team, which branches do those changes have to go through to get to your branch?

The following procedures explain how to use Team Foundation Version Control (TFVC) to answer these types of questions.

View and work with your branches

You can use the Hierarchy window to perform the following tasks:

  • View all your branches in a hierarchical view.
  • View a subset of your branches in a hierarchical view.
  • View properties of a specific branch.
  • Complete tasks for a specific branch.

Important

You can perform these procedures on a branch but not on a folder. In the following screenshot, BuildProcessTemplates is a folder, and Dev is a branch.

Screenshot of the Folders window in Visual Studio. The DinnerNow folder contains a folder named BuildProcessTemplates and a branch named Dev.

For more information, see Branch folders and files.

Display the hierarchy window from Source Control Explorer

  1. In Visual Studio, on the View menu, select Other Windows > Source Control Explorer.

  2. In Source Control Explorer, select the branch that you want to explore the structure of.

  3. On the File menu, select Source Control > Branching and Merging > View Hierarchy.

Adjust the view to show the data you want

By default, when you open the Hierarchy window, you see the hierarchy for the branch that you opened the window from. The view includes the ancestors and descendants of the branch.

The following screenshot shows the Hierarchy window for the DinnerNow Test branch:

Screenshot of Visual Studio with the Test branch hierarchy. Main is a parent branch, Dev is a child, and Dev has two child branches for features.

Use the following options to modify your view of the hierarchy:

  • On the Show menu, select any of the following views:

    • All hierarchies
    • Full hierarchy
    • Ancestors and descendants
    • Ancestors
    • Parent and children
    • Children
    • Customized

    Screenshot of Visual Studio with the Test branch hierarchy. The Show menu is highlighted, and Ancestors and descendants is selected.

    Tip

    If you want to see the full hierarchy for every version control path in your project, select All hierarchies. This view includes hierarchies that are outside the scope of the active project in Source Control Explorer.

  • Next to the Show menu, select the Customize branch list button to individually select the specific branches that you want to see.

    Screenshot of Visual Studio with the Test branch hierarchy. A button to the right of the Show menu is highlighted.

    The Select Branches dialog appears.

    • In the Branches list, select or clear the branches that you want to show or hide. As you select or clear branches, a preview of your selections appears on the right side of the dialog.
    • If your team has many branches, use the buttons above the preview to easily specify the branches that you want to see. Hover over a button to get information about what it does.
  • To fine-tune the details of your diagram, select a specific branch and then select one of the following controls:

    • Select X to hide the branch. Alternatively, select Delete while the branch is selected.
    • Select the plus sign (+) to specify which child branches you want to see. Alternatively, select Insert while the branch is selected.

    Screenshot of Visual Studio with the Test branch hierarchy. On a rectangle that represents the Dev branch, controls on two corners are highlighted.

View properties and take actions

After you view the branch hierarchy, you might need more information, or you might be ready to take some action. You can right-click any branch in the Hierarchy window and take any of the following steps:

  • Select Properties to view information about the branch, including its path, who owns it, and who has permissions to work with it. The Owner field is only for information. The person that's named in the Owner field doesn't necessarily have extra permissions.

  • Select an action such as Branch, Merge, Compare, or Open in Source Control Explorer.