Skip to content

daft multi-remote

Manage multi-remote worktree organization

Description

Manages multi-remote mode, which organizes worktrees by remote when working with multiple remotes (e.g., fork workflows with origin and upstream).

When multi-remote mode is disabled (default), worktrees are placed directly under the project root:

project/
├── .git/
├── main/
└── feature/foo/

When multi-remote mode is enabled, worktrees are organized by remote:

project/
├── .git/
├── origin/
│   ├── main/
│   └── feature/foo/
└── upstream/
    └── main/

Use git daft multi-remote enable to migrate existing worktrees to the multi-remote layout. Use git daft multi-remote disable to migrate back to the flat layout.

Usage

daft multi-remote

Subcommands

enable

Enable multi-remote mode and migrate existing worktrees

Enables multi-remote mode and migrates existing worktrees to the remote-prefixed directory structure.

Each worktree is moved from project/branch to project/remote/branch, where the remote is determined by the branch's upstream tracking configuration or defaults to the specified default remote.

Use --dry-run to preview the migration without making changes.

daft multi-remote enable [OPTIONS]

Options

OptionDescriptionDefault
--default <DEFAULT>Default remote for new branches (defaults to 'origin')
--dry-runPreview changes without executing
-f, --forceSkip confirmation

disable

Disable multi-remote mode and flatten worktree structure

Disables multi-remote mode and migrates worktrees back to the flat directory structure.

Each worktree is moved from project/remote/branch back to project/branch. This command requires that only one remote is configured, as the flat structure cannot distinguish between worktrees from different remotes.

Use --dry-run to preview the migration without making changes.

daft multi-remote disable [OPTIONS]

Options

OptionDescriptionDefault
--dry-runPreview changes without executing
-f, --forceSkip confirmation

status

Show current multi-remote configuration

daft multi-remote status [OPTIONS]

Options

OptionDescriptionDefault
--format <FORMAT>Output format. Mutually exclusive with --template
--template <STR>Tera template string. Mutually exclusive with --format
--no-headersOmit header row (tsv/csv only)

set-default

Change the default remote for new branches

daft multi-remote set-default <REMOTE>

Arguments

ArgumentDescriptionRequired
<REMOTE>Remote name to use as defaultYes

move

Move a worktree to a different remote folder

Moves a worktree from one remote folder to another. This is useful when:

  • You forked a branch and want to organize it under a different remote
  • You're transferring a feature branch from your fork to upstream
  • You want to reorganize worktrees after adding a new remote

The worktree is physically moved on disk, and git's internal worktree records are updated accordingly.

Options like --set-upstream can update the branch's tracking configuration to match the new remote organization.

daft multi-remote move [OPTIONS] <BRANCH>

Arguments

ArgumentDescriptionRequired
<BRANCH>Branch name or worktree path to moveYes

Options

OptionDescriptionDefault
--to <TO>Target remote folder
--set-upstreamAlso update the branch's upstream tracking to the new remote
--pushPush the branch to the new remote
--delete-oldDelete the branch from the old remote after pushing
--dry-runPreview changes without executing
-f, --forceSkip confirmation

Global Options

OptionDescription
-h, --helpPrint help information
-V, --versionPrint version information

Structured Output

daft multi-remote status supports machine-readable output via --format: json, yaml, toon, markdown, plus --template <tera> for custom output.

sh
# Multi-remote configuration as YAML
daft multi-remote status --format yaml

See the Output Formats guide for format details and Tera syntax.

Released under MIT or Apache-2.0.