Create and manage branches in a project

How to add a branch to your SAST & SCA project, or modify a branch that already exists.

Add a branch to a project

Follow these steps to add a branch to a SAST & SCA project. By default, each project can include up to 10 branches.

Note: When you create a project, Polaris creates the project's first (default) branch automatically.
  1. After you open a SAST & SCA project, open the Branches tab.
  2. Select + Create New Branch.
    The Create New Branch window opens.
  3. To create a branch that isn't connected to a repository:
    1. Select Manually create new branch.


    2. Enter a Branch Name. Limit is 255 characters.
      Note: Branch names must be unique within projects.
    3. (Optional) Enter a Branch Description. Limit is 256 characters.
  4. To add a branch from an SCM repository:
    Note: You cannot use this option until you set up an SCM integration. See Integrate a SCM Repository to a Project for more information.
    1. Select Create new branch from SCM integration.


    2. Select a branch in your repository with the SCM Branch dropdown.
  5. (Optional) Select Set as Default Branch for Project to make the branch the default branch for the project.
    Note: Default branches automatically inherit the project's default policies. When you change a project's default branch:
    • The project's default policies are automatically applied to, and enabled on, the new default branch (replacing any policies that were previously assigned to the branch). Organization Admins, Organization Application Admins, and Application Managers can disable policies on the default branch.
    • Policies are automatically disabled on the old default branch.
  6. (Optional) Enable issue, component, and/or test scheduling policies:
    Note: By default, policies are disabled for new branches.
    1. Select the slider to enable policies.


    2. To inherit the project's default policies, select Use Project default policies.
      The project's policies appear in the Issue Policy, Component Policy, and Test Scheduling Policy dropdown menus.
    3. To customize the branch's policies, select Manually select policies. Select policies using the Issue Policy, Component Policy, and Test Scheduling Policy dropdown menus.
      Note: Only Organization Admins, Organization Application Admins, and Application Managers can customize policies for non-default branches. Default branches automatically inherit the project's default policies.
  7. Select Add.

Edit a branch

Follow these steps to modify a branch.

  1. After you open a SAST & SCA project, open the Branches tab.
  2. Select the branch you wish to edit.
    The Edit Branch window opens.


  3. Edit the branch, as required. You can:
    • Change a branch's name or description (for branches that aren't connected to a repository).
    • Change the project's default branch.
      Note: Default branches automatically inherit the project's default policies. When you change a project's default branch:
      • The project's default policies are automatically applied to, and enabled on, the new default branch (replacing any policies that were previously assigned to the branch). Organization Admins, Organization Application Admins, and Application Managers can disable policies on the default branch.
      • Policies are automatically disabled on the old default branch.
    • Change a non-default branch's automatic deletion setting.
    • Enable, disable, or (for non-default branches) customize a branch's policies.
  4. Select Save.

Change a project's default branch

Follow these steps to change a SAST & SCA project's default branch.

  1. After you open a SAST & SCA project, open the Branches tab.
  2. Click the icon at the end of the branch's row and select Make Default Branch.
    Note: Default branches automatically inherit the project's default policies. When you change a project's default branch:
    • The project's default policies are automatically applied to, and enabled on, the new default branch (replacing any policies that were previously assigned to the branch). Organization Admins, Organization Application Admins, and Application Managers can disable policies on the default branch.
    • Policies are automatically disabled on the old default branch.
    Note: Non-default branches may be deleted after a period of inactivity. When you change a project's default branch, the previous default branch inherits the project's branch deletion setting. Edit the previous default branch to modify its automatic deletion setting.

Configure automatic branch deletion

You can configure Polaris to automatically delete non-default branches that aren't tested for a period between 1 and 90 days. By default, non-default branches are retained indefinitely. You can adjust this in each application, project, and branch's settings.
Note: A branch's automatic deletion setting overrides project and application settings; a project's automatic deletion setting overrides application settings. This way, even if an application is configured so non-default branches that aren't tested for a day are deleted, you can still preserve specific branches (or branches in specific projects) indefinitely, or for a longer duration.

Triage data is preserved when a non-default branch is deleted automatically. This way, if you recreate the branch (using the same name) and test the same code, your triage history is restored.

Change an application's automatic branch deletion setting

  1. Go to Portfolio and select an application.
  2. Go to Settings > General.
  3. Adjust the application's Automatic Branch Deletion setting, as required.


  4. Select Save.

Change a project's automatic branch deletion setting

By default, each project follows it's application's branch deletion setting.
  1. Go to Portfolio, select an application, and select a project.
  2. Go to Settings > General.
  3. Adjust the project's Automatic Branch Deletion setting, as required.


    Tip: A project's automatic deletion setting can override its application's setting.
  4. Select Save.

Change a branch's automatic branch deletion setting

Note: See Edit a branch for more information.

Delete a branch

Follow these steps to delete a SAST & SCA project's branch.

  1. After you open a SAST & SCA project, open the Branches tab.
  2. Click the icon at the end of the branch's row and select Delete.
    CAUTION: When you delete a branch, all test results linked to the branch are deleted, too. This action cannot be undone.