Skip to content

Git Branch Creation Rules

MDCMS can automatically create and publish task-based branches for a Git repository once a task reaches a specified status. This ensures branches are not created prematurely and eliminates formatting or spelling errors that can occur when developers create their own branches manually.

The following MDOpen paths are available to view/configure branch creation rules: - DevOps Settings → Git Branch Creation Rules - DevOps Settings → Git Repositories → [select repository] → Git Branch Creation Rules - Tasks → [select task] → Git Branches → Git Branch Creation Rules


Settings

Project

A project whose tasks are relevant to a Git repository.

Task Type

The task type used by the project that should trigger branch creation.

Repository ID

The ID of the Git repository where the branch should be created.

Branch Name

The name of the branch to be created. This can be defined using a combination of static text and placeholders representing task and project information. For example, the format feat-++PRJTSK++ would create branches named feat-MYPROJ-123.1 for tasks in the MYPROJ project with task number 123 and subtask number 1.

Press F7 to view available placeholders and to insert them at the current cursor position in the Branch Name field.

Content-Assist can be used to view the list of existing branch names and to select an existing branch name. Branch creation rules with existing branch names will attempt to create a branch with that name, and if a branch with that name already exists on the Git server, the creation will be considered successful and no new branch will be created.

Create branch from

The existing branch that new task branches should be created from. If left blank or set to *MAIN, new branches are created from the branch designated as the Main Branch for the repository.

Automatic Branch Creation

  • True — MDCMS automatically creates and publishes the branch when a task meets the configured status criteria.
  • False — A user must manually initiate branch creation for each task.

Minimum Status

The minimum status a task must have reached before its branch is created. If left blank, the branch is created as soon as the task is created.

Maximum Status

The maximum status a task may be in for a branch to be created. If left blank, there is no upper status limit.

Generate for Subtasks

  • True — Subtasks of a task that meets the status criteria will also have branches created for them, following the same Branch Name format but with the subtask number included in the placeholders (e.g., MYPROJ-123.1 for the first subtask of task MYPROJ-123).
  • False — Only the main task will have a branch created, and no branches will be created for subtasks.

Reviewing and Manually Creating Branches

Use option Git Branches on a Task to view the most recent branch creation attempt for each repository that has a rule matching the task's Project and Task Type combination.

Click the Create and Publish Branch icon to manually create a branch or to retry a failed attempt.

Check out a Created Branch in the Local Workspace

Once a branch is created and published by MDCMS, developers have the following options to checkout the branch in their local workspace: - perform a fetch within their local clone and then check out the existing branch from the Git server - click the Checkout in Local Workspace icon on the Branch for the Task in MDOpen - request an Object in MDOpen (such as from MDXREF), and then click the Sync with Local Workspace icon on the object request and then click the Checkout in Local Workspace icon