Answers: <p>It's recommended that you use a convention of prefixing your grouped references (like branches) with "folder" prefixes.</p>
  
  <p>For example, when you create sprint branches, create them with the names:</p>
  
  <pre><code>sprints/sprint01
  sprints/sprint02
  sprints/sprint03
  </code></pre>
  
  <p>Then, configure your build trigger <code>Include</code> filters with this prefix:</p>
  
  <p><code>sprints/*</code></p>
  
  <p>... and then an <code>Exclude</code> filter for <code>master</code>, since by default it is also included.</p>
  
  <p>Once configured, this should build only the sprint branch (topic branch) that was committed to.</p>
  
  <p>Reference: <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-build-git?view=azure-devops&amp;tabs=designer" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-build-git?view=azure-devops&amp;tabs=designer</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-04-10T01:38:40.310Z
Answers: If i configure `sprints/*` and a developer make a push on the `sprint03`, will it build branches `sprint01` and `sprint02`?
Answers: Felipe Oriani
Answers: CC BY-SA 4.0
Answers: 2019-04-10T01:51:06.907Z
Answers: @FelipeOriani No, it should only build sprint03 as the trigger should see the specific branch that triggered it that matches the wildcard.  I've only used similar wildcards when wanting to trigger builds when tags are created (`refs/tags/*`), but the filtering should be the same.  Test it out and report back.
Answers: Sumo
Answers: CC BY-SA 4.0
Answers: 2019-04-10T00:18:31.483Z
Answers: 2019-04-10T00:18:31.483Z
Answers: Sumo
Body: <p>On the Azure DevOps, in we <code>git</code> we have a schema of branches where we create a branch per <code>sprint</code>, for sample:</p>
  
  <ul>
  <li>sprint01</li>
  <li>sprint02</li>
  <li>sprint03
  ...</li>
  </ul>
  
  <p>We keep the 3 last <code>sprint</code> branches, and in this case when I create the <code>sprint4</code> branch, we will drop the <code>sprint01</code>. Each sprint  We publish a version of our product every week. On the <code>build</code> pipeline definition on our project, we have defined the trigger to run over a push on the <code>sprint*</code> branch because we don't want to change the definition on each new version.</p>
  
  <p>It works but it runs a build for each <code>sprint</code> branch and a release for each one. I would like to have just for that branch (with prefix <code>sprint</code>) that was pushed on the git. Is there any way to configure it?</p>
  
  <p>My current configuration:</p>
  
  <p><a href="https://i.sstatic.net/XJM2C.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XJM2C.png" alt="enter image description here"></a></p>
  
Comments: CC BY-SA 4.0
Comments: 2019-04-08T09:47:41.543Z
Comments: What do you mean "it runs a build for each sprint branch"?
Comments: Shayki Abramczyk
Comments: CC BY-SA 4.0
Comments: 2019-04-08T12:25:15.993Z
Comments: For sample, If I have branches called `sprint01`, `sprint02`, `sprint03`, the trigger will run a build for each branch. I wish to run just for the branch that was pushed.
Comments: Felipe Oriani
Comments: CC BY-SA 4.0
Comments: 2019-04-08T12:26:27.807Z
Comments: If you push from `sprint01` so 3 different builds will be executed? (3 build run in parallel?)
Comments: Shayki Abramczyk
Comments: CC BY-SA 4.0
Comments: 2019-04-08T12:30:12.057Z
Comments: Yes, because I have configured `sprint*`. If I push sprint03 I wish to run just a build/release for this. I know I can configure a fixed branch, but we have a new sprint every monday, I would like to have this automatically.
Comments: Felipe Oriani
Comments: CC BY-SA 4.0
Comments: 2019-04-08T12:34:57.513Z
Comments: I don't know if it is possible to configure.
Comments: Felipe Oriani
Comments: CC BY-SA 4.0
Comments: 2019-04-08T12:38:47.363Z
Comments: I just tried it on my side, only 1 build run, with the branch where I did push. can you share screenshots from the summary page what happened when you push to specific sprint branch?
Comments: Shayki Abramczyk
Comments: CC BY-SA 4.0
Comments: 2019-05-10T06:27:23.333Z
Comments: If I am getting your question correct, [This](https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-build-git?view=azure-devops&tabs=classic) might be useful.
Comments: Darshana Patel
Tags: <azure-devops><build-pipeline><release>
Title: How trigger a build by a commit in a branch prefix?
UserDisplayName: Felipe Oriani
ThreadText: # How trigger a build by a commit in a branch prefix?
  
  (Asked by: username_0 on 2019-04-04)
  
  On the Azure DevOps, in we `git` we have a schema of branches where we create a branch per `sprint`, for sample:
  
  * sprint01
  * sprint02
  * sprint03
    ...
  
  We keep the 3 last `sprint` branches, and in this case when I create the `sprint4` branch, we will drop the `sprint01`. Each sprint We publish a version of our product every week. On the `build` pipeline definition on our project, we have defined the trigger to run over a push on the `sprint*` branch because we don't want to change the definition on each new version.
  
  It works but it runs a build for each `sprint` branch and a release for each one. I would like to have just for that branch (with prefix `sprint`) that was pushed on the git. Is there any way to configure it?
  
  My current configuration:
  
  [![enter image description here](https://i.sstatic.net/XJM2C.png)](https://i.sstatic.net/XJM2C.png)
  
  **Tags:** azure-devops, build-pipeline, release
  
  > **Comments:**
  > **username_1**: What do you mean "it runs a build for each sprint branch"?  
  > **username_0**: For sample, If I have branches called `sprint01`, `sprint02`, `sprint03`, the trigger will run a build for each branch. I wish to run just for the branch that was pushed.  
  > **username_1**: If you push from `sprint01` so 3 different builds will be executed? (3 build run in parallel?)  
  > **username_0**: Yes, because I have configured `sprint*`. If I push sprint03 I wish to run just a build/release for this. I know I can configure a fixed branch, but we have a new sprint every monday, I would like to have this automatically.  
  > **username_0**: I don't know if it is possible to configure.  
  > **username_1**: I just tried it on my side, only 1 build run, with the branch where I did push. can you share screenshots from the summary page what happened when you push to specific sprint branch?  
  > **username_2**: If I am getting your question correct, [This](https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-build-git?view=azure-devops&tabs=classic) might be useful.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-04-10. Score: 0 | Accepted answer
  
  It's recommended that you use a convention of prefixing your grouped references (like branches) with "folder" prefixes.
  
  For example, when you create sprint branches, create them with the names:
  
  ```
  sprints/sprint01
  sprints/sprint02
  sprints/sprint03
  
  ```
  
  Then, configure your build trigger `Include` filters with this prefix:
  
  `sprints/*`
  
  ... and then an `Exclude` filter for `master`, since by default it is also included.
  
  Once configured, this should build only the sprint branch (topic branch) that was committed to.
  
  Reference: <https://docs.microsoft.com/en-us/azure/devops/pipelines/build/ci-build-git?view=azure-devops&tabs=designer>
  
  > **Comments:**
  > **username_0**: If i configure `sprints/*` and a developer make a push on the `sprint03`, will it build branches `sprint01` and `sprint02`?  
  > **username_3**: @username_0 No, it should only build sprint03 as the trigger should see the specific branch that triggered it that matches the wildcard.  I've only used similar wildcards when wanting to trigger builds when tags are created (`refs/tags/*`), but the filtering should be the same.  Test it out and report back.  
  
  ---
  
  