Description
Promote an experiment to a permanent Git branch. This command creates a Git branch from an experiment, making it part of your regular Git history. This is useful when you want to preserve a successful experiment as a permanent branch for collaboration, code review, or deployment.Usage
Arguments
string
required
The experiment name to promote to a branch.Can be:
- Auto-generated experiment name (e.g.,
exp-a1b2c) - Custom experiment name (specified with
-nduringdvc exp run)
string
Name for the new Git branch. If not specified, defaults to
{experiment-name}-branch.Examples
Create branch with auto-generated name
The default branch name is the experiment name with
-branch appended.Create branch with custom name
Push branch to remote
Create branch and switch to it
The new branch contains the full experiment state including code, parameters, and DVC pipeline information.
List and promote workflow
Common Workflows
Collaboration Workflow
Production Release Workflow
Multi-stage Promotion
Feature Branch Workflow
Understanding Branch Creation
When you create a branch from an experiment:What Gets Included
-
Git Commit: A proper Git commit is created containing:
- Code changes from the experiment
- Parameter files (
params.yaml) - DVC pipeline files (
dvc.yaml,dvc.lock) - Metrics files
-
Commit Message: Auto-generated message includes:
- Experiment name
- Timestamp
- Changed metrics and parameters
- DVC Cache: References to cached model outputs and data
The branch is a full Git branch, indistinguishable from branches created manually. It can be merged, rebased, and pushed like any other branch.
Branch vs Apply
Choose betweendvc exp branch and dvc exp apply:
Integration with Git
View branch history
Merge to main branch
Delete branch after merge
Troubleshooting
Branch already exists
Experiment not found
Related Commands
dvc exp show- View available experiments to promotedvc exp apply- Apply experiment to workspace without creating branchdvc exp run- Create new experimentsdvc exp remove- Remove experiments (doesn’t affect created branches)git branch- Standard Git branch operations