Connectors

/

Azure DevOps

/

Audit Azure DevOps branch hygiene
Report

Clean up stale branches without the guesswork

For developers and release engineers who want to know which Azure DevOps branches are safe to retire, just by asking their AI assistant.

Try PopdockAI free
Get a live demo
Audit Azure DevOps branch hygiene
Audit the branches in the Contoso.Web repository in Azure DevOps and tell me which ones we can clean up.
Contoso.Web has 41 branches. 12 look safe to clean up. - Stale (no push in 90+ days): 9 branches, for example feature/old-checkout - Locked: 1 branch, release/2.3 - Far behind main: 2 branches, 200+ commits - Skipped: main and 4 branches with active pull requests Want the full list with last author and date for each?
Azure DevOps
Sample figures. Your results come from your own account.
azure-devops-get-repository
azure-devops-get-branch-stat
azure-devops-get-git-ref
azure-devops-get-tag

On this page

The problem

The problem

The prompt

Who it's for

How it works

Tools used

Connector

Azure DevOps

Azure DevOps
Run it on your own Azure DevOps data.

Connect Azure DevOps, pick your AI tool and paste the prompt.

Try PopdockAI free

The problem

Repositories fill with branches nobody owns

Repositories collect branches that nobody owns any more. Working out which are stale, locked or far behind the default branch means opening each one, and nobody wants to clean up a branch that might still matter.

Without PopdockAI

  • Open each branch to check its last commit
  • Work out how far it has diverged from the default
  • Check for locks and active pull requests
  • Leave everything in place to be safe

With PopdockAI

  • Every branch is read with age, lock state and divergence
  • The default branch and branches with active pull requests are set aside
  • Stale, locked and diverged branches are grouped
  • Each gets a suggested action, and nothing is deleted or locked

The prompt

Use this prompt

Copy it into any AI tool connected to PopdockAI. Swap the values in braces for your own.

Prompt
**Objective:** Audit branches and tags in `{repository-name}` and list cleanup candidates: branches with no commits for `{stale-days}` days (default 90), locked refs and far-diverged branches.

**Step 1: Resolve the repository**

Call `azure-devops-get-repository` with name `{repository-name}`; note id and default-branch.

**Step 2: Read branches**

Call `azure-devops-get-branch-stat` with repository-id and commit-date.to set to the stale cutoff. Also call `azure-devops-get-git-ref` with repository-id and `azure-devops-get-tag` for context, noting is-locked refs and the creator.

**Step 3: Rank candidates**

Rank by days since last commit, then by ahead-count. A branch with ahead-count 0 is likely already merged.

**Step 4: Report**

A table of branch, last commit date, author, ahead and behind counts and a suggested action (delete, ask owner, keep), plus counts for locked refs and tags.

**Rules & Guidelines:**

* This prompt is read-only. Call only the `azure-devops-get-*` read tools named above; never create, update, comment on, approve, queue, abort or delete anything in Azure DevOps.
* The tools only return data the connected account can see; never infer data from projects outside that access.
* Never delete or lock branches; list candidates only.
* Never suggest deleting the default branch or any branch behind a pull request that is still active.

**Validation:**

* If no branches are stale, say so.

Who it's for

One answer, three teams that use it

Developers

Tidy a repository without fear

See which branches are stale or far behind, with a suggested action, and none that are still in use.

Which branches in the Fabrikam.Api repository in Azure DevOps are stale?

Tech leads

Keep the branch list readable

Run a quick hygiene check before a release so the team works from a clean list.

Audit branch hygiene in the Northwind.Portal repository and group stale, locked and diverged branches.

DevOps engineers

Find locked and diverged branches

Locked branches and those far behind the default are called out, ready for a decision.

List locked branches and branches more than 100 commits behind main in Contoso.Services.

How it works

What PopdockAI does when you ask

You name a repository and your AI assistant builds a safe cleanup list. It only reports, so nothing is deleted or locked.

01

Ask

You name the Azure DevOps repository.

Your AI tool

02

Read

It reads every branch with its age, lock state and divergence from the default.

azure-devops-get-repository
azure-devops-get-branch-stat
azure-devops-get-git-ref
azure-devops-get-tag

03

Check

It sets aside the default branch and any branch with an active pull request.

No items found.

04

Report

You get stale, locked and diverged branches with a suggested action each.

Your AI tool

What PopdockAI provides

The tools behind the answer

Ready made tools for Azure DevOps and one secure connection to your AI tool. No code, no exports.

get-data

azure-devops-get-repository

Returns repositories records from the Azure DevOps connector. Use it to read and filter repositories across your Azure DevOps projects.
get-data

azure-devops-get-branch-stat

Returns branch stats records from the Azure DevOps connector. Use it to read and filter branch stats across your Azure DevOps projects.
get-data

azure-devops-get-git-ref

Returns git refs records from the Azure DevOps connector. Use it to read and filter git refs across your Azure DevOps projects.
get-data

azure-devops-get-tag

Returns tags records from the Azure DevOps connector. Use it to read and filter tags across your Azure DevOps projects.
Read only.Nothing in Azure DevOps Changes

This report is built from Get data tools only. PopdockAI applies the row, field and parameter rules your admin sets, and every query is written to the audit trail.

How Popdock AI secures your data

The outcome

A safe branch cleanup list

Try PopdockAI free
Get a live demo

Related use cases

More ways to put this data to work

All Ramp use cases

One prompt template with infinite possibilities.

‍

Your AI assistant adapts its approach, tone, and capabilities to match each unique context while you maintain a single, manageable workflow.

Join forward-thinking companies that are transforming their operations with intelligent, secure AI automation.

Try PopdockAI Free
See Documentation