Skip to content

git worktree-fetch

Update worktree branches from their remote tracking branches

TIP

This command is also available as daft update. See daft update.

Description

Updates worktree branches from their remote tracking branches.

Targets can use refspec syntax (source:destination) to update a worktree from a different remote branch:

Same-branch: daft update master (pulls master via git pull --ff-only) Cross-branch: daft update master:test (fetches origin/master, resets test to it) Current: daft update (pulls current worktree's tracking branch) All: daft update --all (pulls all worktrees)

Same-branch mode uses git pull with configurable options (--rebase, --ff-only, --autostash, -- PULL_ARGS). Cross-branch mode uses git fetch

  • git reset --hard and ignores pull flags.

Worktrees with uncommitted changes are skipped unless --force is specified. Use --dry-run to preview what would be done without making changes.

Usage

git worktree-fetch [OPTIONS] [TARGETS] [PULL_ARGS]

Arguments

ArgumentDescriptionRequired
<TARGETS>Target worktree(s) by name or refspec (source:destination)No
<PULL_ARGS>Additional arguments to pass to git pullNo

Options

OptionDescriptionDefault
--allUpdate all worktrees
-f, --forceUpdate even with uncommitted changes
--dry-runShow what would be done
--rebaseUse git pull --rebase
--autostashUse git pull --autostash
--ff-onlyOnly fast-forward (default)
--no-ff-onlyAllow merge commits
-v, --verboseBe verbose; show detailed progress
-q, --quietSuppress non-error output

Global Options

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

See Also

Released under the MIT License.