Complete command-line interface reference for the DGT (Dart Gerrit Tool).
These options are available for all commands.
--help, -h Show help information
--version Show version information
--verbose, -v Enable verbose output with detailed execution information
--timing, -t Show performance timing breakdown after execution--path <path>, -p <path> Specify repository path (default: current directory)Alias for dgt list. Lists all local branches with their Gerrit status.
Lists all local Git branches with their Gerrit code review status.
dgt list [options]--gerrit / --no-gerrit Show or hide Gerrit columns (hash, date) [default: true]
--local / --no-local Show or hide local columns (hash, date) [default: true]
--url Show Gerrit URL column [default: false]
--dates <timezone> Timezone for date columns: local, utc [default: local]--status <status> Filter by Gerrit status (can be used multiple times)
Allowed values: active, wip, merged, abandoned, conflict, gerrit, local
--since <date> Show branches with commits after this date (ISO 8601 format)
--before <date> Show branches with commits before this date (ISO 8601 format)
--diverged Show only branches with local or remote differences--sort <field> Sort branches by field
Allowed values: local-date, gerrit-date, status, divergences, name
--asc Sort in ascending order [default]
--desc Sort in descending order# Basic usage
dgt list
dgt
# Filter examples
dgt list --status active
dgt list --status active --status wip
dgt list --since 2025-10-01 --before 2025-10-10
dgt list --diverged
# Sort examples
dgt list --sort local-date --desc
dgt list --sort status --asc
# Display options
dgt list --no-gerrit
dgt list --url --verbose
# Combined options
dgt list --status active --diverged --sort local-date --desc --urlManage configuration settings to set default preferences.
dgt config [subcommand] [options]dgt config Show current configuration
dgt config [options] Save configuration options
dgt config clean Reset configuration to defaultsAll options from dgt list can be saved as defaults:
# Display options
--gerrit / --no-gerrit
--local / --no-local
--url
--dates <timezone>
# Filter options
--status <status>
--since <date>
--before <date>
--diverged
# Sort options
--sort <field>
--asc / --desc--no-status Remove saved status filter defaults
--no-sort Remove saved sort defaults--force Reset configuration without confirmation prompt- Location:
~/.dgt/.config - Format: JSON
- Scope: User-level (applies to all repositories)
{
"local": true,
"gerrit": true,
"url": false,
"dates": "local",
"filterStatuses": ["active", "wip"],
"filterSince": "2025-01-01",
"filterBefore": "2025-12-31",
"filterDiverged": true,
"sortField": "local-date",
"sortDirection": "desc"
}Only the keys you have set are written; anything absent falls back to the built-in default.
# View current configuration
dgt config
# Save display preferences
dgt config --no-gerrit --url
# Save a timezone for the date columns
dgt config --dates utc
# Save filter preferences
dgt config --status active --status wip --diverged
# Save sort preferences
dgt config --sort local-date --desc
# Remove specific options
dgt config --no-status
dgt config --no-sort
# Reset everything
dgt config clean
dgt config clean --forceWrapper around git cl archive command for cleaning up branches.
dgt clean [git-cl-archive-options...]All arguments after clean are passed directly to git cl archive.
# Basic cleanup
dgt clean
# Archive with deletion
dgt clean --delete
# Force archive without prompts
dgt clean --force --delete
# Any git cl archive options work
dgt clean --dry-run --delete| CLI Value | Display Value | Description | Color |
|---|---|---|---|
active |
Active |
Ready for review (NEW, not WIP, mergeable) | Green |
wip |
WIP |
Work in Progress | Yellow |
merged |
Merged |
Successfully merged | Cyan |
abandoned |
Abandoned |
Abandoned change | Gray |
conflict |
Merge conflict |
Cannot be merged, needs rebase | Red |
gerrit |
various | All branches with Gerrit configuration | - |
local |
- |
No Gerrit configuration (local-only) | White |
| Field | Description | Sort Behavior |
|---|---|---|
local-date |
Local commit date | Sorts by commit timestamp |
gerrit-date |
Gerrit update date | Sorts by last Gerrit update |
status |
Gerrit status | Sorts by urgency: merge conflict, WIP, active, merged, abandoned, then branches with no change |
divergences |
Divergence state | Sorts by: both diverged, one side, in sync |
name |
Branch name | Sorts alphabetically by branch name |
All date inputs use ISO 8601 format:
# Date only
2025-10-01
2025-12-25
# Date and time
2025-10-01T14:30:00
2025-10-01T14:30:00Z
2025-10-01T14:30:00-07:00
# Partial formats
2025-10
2025dgt list --since 2025-10-01
dgt list --before 2025-10-31T23:59:59
dgt config --since 2025-01-01 --before 2025-12-31The Local Date and Gerrit Date columns show yyyy-MM-dd HH:mm. Both
sources give absolute instants — git prints a UTC offset in its %ci format,
and Gerrit documents its timestamps as UTC — so both columns are converted to
the same timezone and can be compared directly.
| Value | Behavior |
|---|---|
local |
The machine's local timezone. The default. |
utc |
Coordinated Universal Time. |
# Show this run in UTC
dgt list --dates utc
# Make UTC the default for every run
dgt config --dates utc
# Go back to local time
dgt config clean --datesThe output table includes these columns (when enabled):
- Branch Name - Local Git branch name
- Status - Gerrit status or "-" for local-only branches
- Local Hash - First 8 characters of local commit hash
- Local Date - Local commit date in YYYY-MM-DD HH:MM format
- Gerrit Hash - First 8 characters of Gerrit revision hash
- Gerrit Date - Gerrit update date in YYYY-MM-DD HH:MM format
- URL - Gerrit change URL (when
--urlis used)
- Green: Active changes ready for review
- Yellow: Work in Progress changes or diverged information
- Cyan: Successfully merged changes
- Red: Changes with merge conflicts
- Gray: Abandoned changes
- White: Local-only branches or default text
When local and Gerrit states differ, the differing information is highlighted in yellow:
feature/example | Active | abc12345 | 2025-10-09 15:00 | def67890 | 2025-10-09 10:00
^^^^^^^^ ^^^^^^^^^^^^^^^^
(highlighted - different from local)
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (invalid arguments, Git errors, etc.) |
| 2 | Not in a Git repository |
DGT respects standard environment variables:
HOME/USERPROFILE- Used for configuration file locationPATH- Used to locate Git executableGIT_DIR- Git repository directory (if set)
Settings are resolved in this order (highest to lowest priority):
- Command-line flags - Explicit options provided with command
- Configuration file - Saved defaults in
~/.dgt/.config - Built-in defaults - Hardcoded default values
If you have saved --status active in config but run dgt list --status wip, the command-line --status wip takes precedence.
Error: Not a Git repository
Please run this command from within a Git repository.
Invalid date format: "2025/10/01". Expected ISO 8601 format (e.g., 2025-10-10 or 2025-10-10T14:30:00)
The current --status given value "invalid" is not valid.
Allowed values:
active (Ready for review)
wip (Work in Progress)
merged (Successfully merged)
abandoned (Abandoned changes)
conflict (Has merge conflicts)
gerrit (All Gerrit statuses)
local (Branches without Gerrit configuration)
Invalid sort field: "invalid-field".
Allowed values:
local-date (Local commit date)
gerrit-date (Gerrit update date)
status (Gerrit status)
divergences (Divergence state)
name (Branch name)
- Small repositories (< 10 branches): < 1 second
- Medium repositories (10-50 branches): 1-2 seconds
- Large repositories (50+ branches): 2-3 seconds
- Use filters to reduce processing:
--status active - Hide unnecessary columns:
--no-gerritskips API calls entirely - Use batch operations: DGT automatically optimizes Git and API calls
Use --timing to see execution breakdown:
Performance Summary:
Branch discovery: 45ms
Git operations: 120ms
Gerrit queries: 850ms
Data processing: 35ms
Output formatting: 15ms
Total execution time: 1065ms
# Quick status check
alias dgs='dgt --status active --status wip'
# Recent work
alias dgr='dgt --since $(date -d "1 week ago" +%Y-%m-%d)'
# Diverged branches
alias dgd='dgt --diverged --sort divergences --desc'# In .git/hooks/post-checkout
#!/bin/bash
echo "Branch status:"
dgt --status active --status wip --diverged# Check for stale branches in CI
dgt --status active --before $(date -d "30 days ago" +%Y-%m-%d) --format jsonThis CLI reference provides complete documentation of all command-line options, behaviors, and usage patterns for the DGT tool.