
To hand over the branch management to Bamboo: You can specify how often Bamboo checks the primary source repository for new or deleted branches in the general branch settings. You can override the branch deletion settings in the branch details configuration view.

You can override the default settings for a branch, such as values of the variables.
#GIT LIST BRANCHES REGULAR EXPRESSION MANUAL#
Automatic branch management is available for Git, Mercurial, and Subversion. For other repository types, you can use manual branching. Plan branches can be created and deleted automatically based on the updates in the primary source repository. The settings provided in the branch configuration override the settings provided for the plan. The branch configuration can be provided on the plan level and customized on the branch level. You can create plan branches manually or automatically. You can also access the branch list from the Plan summary view: For example, you can select the Branch icon next to the plan name in the Build dashboard view: You can access the list of all branches in a plan from different places. Use the Branch status page for quick access to plan branch information. trunk, default, or mainline branch) when the build succeeds.


The -v flag instructs egrep to print lines that do not match a given regular expression. We use egrep (or extended grep) to search using extended regular expressions. We're not specifying a commit, so the command will use the HEAD - the current local state of the main branch. The official git documentation writes this as "list branches whose tips are reachable from the specified commit ( HEAD if not specified)". This command checks out the main branch, and lists all branches that can be detected as being merged into the main branch.
#GIT LIST BRANCHES REGULAR EXPRESSION CODE#
In short, the code above checks out the main branch, lists all merged branches, searches for and lists branches that are not named exactly "main", and uses git to delete those branches on your local machine.

Enter fullscreen mode Exit fullscreen mode
