In this context, these branches likely represent different levels or types of branches within a branching strategy:

  1. Main/Branch:
    • The primary branch representing stable and production-ready code. It’s typically the branch from which other branches are derived.
  2. Collaboration Branch:
    • A branch used for collaborative work where multiple developers collaborate on shared tasks or ongoing development efforts without directly impacting the main codebase.
  3. Feature Branch:
    • Branches created from either the Main or Collaboration branch for developing specific features or functionalities. These branches isolate work on individual features, allowing separate development and integration before merging back into the Main or Collaboration branches.

The branch hierarchy in Azure DevOps with examples

Main/Branch:

  • Purpose: Represents the stable and production-ready code.
  • Example: Suppose your repository starts with a main branch named main or master. It holds the code that is deployed and used in production.

Collaboration Branch:

  • Purpose: Used for ongoing collaborative work among multiple developers.
  • Example: Let’s say you create a branch named collaboration from the main branch. This branch is where developers collaborate on shared tasks, conduct code reviews, and integrate their work before merging it into the main branch.

Feature Branches:

  • Purpose: Created from either Main or Collaboration for developing specific features or functionalities.
  • Example: Developers create feature branches for individual tasks or features. For instance:
    • A developer working on a new login feature might create a branch named feature/login from the Collaboration branch.
    • Another developer working on a product search feature could create a branch named feature/search from the Main branch.
Main/Branch (e.g., 'main' or 'master')  [Stable codebase for production]
  |
  └─ Collaboration (Derived from Main)  [Collaborative workspace]
       |
       ├─ Feature/Login (Derived from Collaboration) [Specific feature development]
       |
       └─ Feature/Search (Derived from Main) [Another specific feature]

In this example:

  • The Main branch holds stable code for production.
  • The Collaboration branch is for ongoing collaborative work among developers.
  • Feature branches (Feature/Login and Feature/Search) are created from either Main or Collaboration for developing specific features.

Developers work in their respective feature branches, making changes related to their assigned tasks. Once the feature is complete and tested, it’s merged back into the Collaboration branch for integration and further testing. Eventually, the changes are merged into the Main branch for deployment to production.