Some repositories keep several lines of the same code side by side: one branch per supported product version, release branches, or a long-lived fork. A task can name the branches it applies to. One run then works on all of them and opens one pull request per branch, each into its own branch.
Without branches, a task works on the repository's default branch, as before.
Two common uses
The same fix on several versions. Choose the branches the fix belongs on, for example 16.0, 17.0 and 18.0. The branches are checked out side by side and the change is made on each one, adapted to what that branch contains - versions often differ in APIs, dependencies or file layout. A branch that turns out not to need a change gets no pull request.
An upgrade to a new version. Add a new branch, for example 20.0 created from 19.0. CodeLynq first creates 20.0 as an exact copy of 19.0. The upgrade itself - version numbers, dependencies, code changes, migration steps - then arrives as a pull request into 20.0, so you review it before it lands. If 20.0 already exists, it is used as it is and never overwritten.
Choose branches when creating a task
In the task form (Tasks → New task, or More options in a project's quick task form): pick the project. Under Branches, click Choose branches next to a repository.
- Click branches to select them. Maintained branches are listed first; All maintained selects them all. Other branches shows the rest.
- To start a new line, type its name under New branch, pick the branch to copy from, and click Add.
- Use default branch removes the selection.
In the new-task chat: just say it - "fix the rounding error on 16.0 and 17.0", "upgrade the module and create the 20.0 branch". The chat knows the repository's branches, asks when it is unclear which ones you mean, and lists them in the draft before you create the task.
Change branches on an existing task
Open the task. Next to Branches, click Edit, change the selection and click Save. The change applies to the next run. While a run is working on the task, editing is disabled.
Follow the results
The run page lists every pull request with the branch it targets (for example → 17.0). Review and merge each one in your git host as usual. If you use the CI feedback loop, each pull request is followed up on its own branch.
Good to know
- Separate tasks for "the same fix on several versions" and "upgrade to a new version" are easier to review than one task doing both.
- Add anything specific to your setup to the task or the project context, for example where the version number is kept. It makes the result more reliable.
- On a merge into a branch other than the default branch, automatic deployments only run for deploy targets set to that branch, or set to no branch.
- Self-hosted runners need version 1.4.0 or newer for tasks with several branches.