coleam00/Archon · error
Cannot determine git remote for ${repoPath}: no git remote i
Error message
Cannot determine git remote for ${repoPath}: no git remote is configured. Add one with `git remote add origin URL`, or use `--no-worktree` to run in the live checkout. What it means
resolveRemote determines which git remote to use for fetch/push. It first honors `worktree.remote` config, then tries getDefaultRemote (which prefers 'origin'). When the repo has no remotes at all, Archon cannot sync or push worktree branches, so it throws with an actionable hint instead of failing later with a confusing git error.
Source
Thrown at packages/isolation/src/providers/worktree.ts:896
getLog().info({ repoPath, remote: detected }, 'worktree.remote_auto_detected');
}
return detected;
}
// Distinguish no remotes from multiple non-origin remotes for an actionable error.
let remoteNames: string[] | null = null;
try {
const { stdout } = await execFileAsync('git', ['-C', repoPath, 'remote'], { timeout: 10000 });
remoteNames = stdout
.split(/\r?\n/)
.map(remote => remote.trim())
.filter(remote => remote.length > 0);
} catch {
// Best-effort for error message only
}
if (remoteNames?.length === 0) {
throw new Error(
`Cannot determine git remote for ${repoPath}: no git remote is configured. ` +
'Add one with `git remote add origin URL`, or use `--no-worktree` to run in the live checkout.'
);
}
const remoteList = remoteNames?.join(', ') ?? '<unknown>';
throw new Error(
`Cannot determine git remote for ${repoPath}: no 'origin' remote found and ` +
`multiple remotes exist (${remoteList}). ` +
'Set worktree.remote in .archon/config.yaml to specify which remote to use.'
);
}
/**
* Sync workspace with remote before creating a new worktree
* Ensures new work starts from the latest code on the base branch.
*
* Branch resolution:View on GitHub (pinned to 0773b97458)
Solutions
- Add a remote: `git remote add origin <URL>`
- Set the remote explicitly in `.archon/config.yaml` via `worktree.remote` only after a remote exists (this error means none do)
- Run with `--no-worktree` to work in the live checkout instead of an isolated worktree
- Verify with `git remote -v` that at least one remote is registered
Example fix
# before git remote -v # (empty) # after git remote add origin git@github.com:acme/myrepo.git
Defensive patterns
Strategy: validation
Validate before calling
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
const execFileAsync = promisify(execFile);
export async function hasGitRemote(repoPath: string): Promise<boolean> {
const { stdout } = await execFileAsync('git', ['-C', repoPath, 'remote']);
return stdout.split(/\r?\n/).map(s => s.trim()).filter(Boolean).length > 0;
} Prevention
- Run `git remote -v` after cloning and before enabling worktree isolation
- Never strip the remote from Archon-managed workspace clones
- Add `origin` immediately when importing a repo via local copy or `git init`
- Prefer `--no-worktree` only when you intentionally want the live checkout
When it happens
Trigger: Creating a worktree (WorktreeProvider.create → resolveRemote) against a repo where `git remote` lists zero remotes and no `worktree.remote` is configured in `.archon/config.yaml`.
Common situations: A repo cloned via local path copy or `git init` without ever adding a remote; a workspace directory that is a git repo but was detached from its origin; CI checkouts created with `--depth 1` from a tarball rather than a clone.
Related errors
- Cannot determine git remote for ${repoPath}: no 'origin' rem
- Cannot adopt run '${options.adoptRunId}': workflow '${workfl
- Cannot verify worktree ownership at ${worktreePath}: ${(erro
- Cannot adopt ${worktreePath}: .git pointer is not a git-work
- Worktree at ${worktreePath} belongs to a different clone (${
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/9f199e7393ccc84f.
Report an issue: GitHub.