Context
Raised in PR #1 review (comment). Currently the tool hard-codes origin as the remote name in several places:
gitFetch() in src/lib/git.ts — git fetch origin --prune
create command in src/commands/create.ts — origin/${opts.name} branch lookups and origin/${base} fallback
This breaks workflows where the primary remote is named something other than origin (e.g., upstream, main).
Proposed Solution
Add an optional REMOTE key to .worktreerc config (defaulting to origin):
DEFAULT_BASE=origin/dev
REMOTE=origin
Then use the configured remote name throughout:
gitFetch(remote) instead of gitFetch() with hard-coded origin
- Branch lookups use
${remote}/${name} instead of origin/${name}
Files to Change
src/lib/config.ts — add REMOTE to config schema with default "origin"
src/lib/git.ts — gitFetch accepts a remote parameter
src/commands/create.ts — use config.REMOTE instead of "origin" string literals
Notes
Deferred from PR #1 as it requires coordinated changes across config, git wrappers, and the create command. Not a bug — origin is the standard convention — but a useful enhancement for non-standard setups.
Context
Raised in PR #1 review (comment). Currently the tool hard-codes
originas the remote name in several places:gitFetch()insrc/lib/git.ts—git fetch origin --prunecreatecommand insrc/commands/create.ts—origin/${opts.name}branch lookups andorigin/${base}fallbackThis breaks workflows where the primary remote is named something other than
origin(e.g.,upstream,main).Proposed Solution
Add an optional
REMOTEkey to.worktreercconfig (defaulting toorigin):Then use the configured remote name throughout:
gitFetch(remote)instead ofgitFetch()with hard-codedorigin${remote}/${name}instead oforigin/${name}Files to Change
src/lib/config.ts— addREMOTEto config schema with default"origin"src/lib/git.ts—gitFetchaccepts aremoteparametersrc/commands/create.ts— useconfig.REMOTEinstead of"origin"string literalsNotes
Deferred from PR #1 as it requires coordinated changes across config, git wrappers, and the create command. Not a bug —
originis the standard convention — but a useful enhancement for non-standard setups.