Skip to main content

Description

dvc.api.all_branches() returns a list of all Git branches in a DVC repository. This is useful for iterating over branches to compare data, metrics, or parameters across different branches.

Signature

Parameters

str
default:"None"
Location of the DVC repository. Defaults to the current project (found by walking up from the current working directory tree).Can be:
  • Local file system path
  • URL (HTTP/HTTPS)
  • Git SSH URL (e.g., user@server:project.git)

Returns

list[str]
List of Git branch names in the repository

Examples

List branches in current repository

List branches in remote repository

Compare metrics across branches

Iterate over all branches and revisions

Use cases

Branch comparison

Compare metrics or parameters across different branches

CI/CD workflows

Automate testing or deployment across all active branches

Branch analysis

Analyze experiment results from different development branches

Data validation

Verify data consistency across branches