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
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 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
Related functions
all_commits()- List all commits in a repositoryall_tags()- List all Git tags in a repositoryparams_show()- Get parameters for a specific revisionmetrics_show()- Get metrics for a specific revision