{"record":{"id":"0dde8d93545228a9","repo":"windmill-labs/windmill","slug":"no-git-sync-repositories-configured-in-workspace","errorCode":null,"errorMessage":"No git-sync repositories configured in workspace","messagePattern":"No git-sync repositories configured in workspace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/utils/utils.ts","lineNumber":247,"sourceCode":"\nexport function printSync(input: string | Uint8Array) {\n  process.stdout.write(\n    typeof input === \"string\" ? input : Buffer.from(input)\n  );\n}\n\n// Repository interface for shared selection logic\nexport interface Repository {\n  git_repo_resource_path: string;\n}\n\n// Shared repository selection logic\nexport async function selectRepository<T extends Repository>(\n  repositories: T[],\n  operation?: string\n): Promise<T> {\n  if (repositories.length === 0) {\n    throw new Error(\"No git-sync repositories configured in workspace\");\n  }\n\n  if (repositories.length === 1) {\n    const repoPath = repositories[0].git_repo_resource_path.replace(\n      /^\\$res:/,\n      \"\"\n    );\n    log.info(colors.cyan(`Auto-selected repository: ${colors.bold(repoPath)}`));\n    return repositories[0];\n  }\n\n  // Check if we're in a non-interactive environment\n  const isInteractive = !!process.stdin.isTTY && !!process.stdout.isTTY;\n\n  if (!isInteractive) {\n    const repoPaths = repositories.map((r) =>\n      r.git_repo_resource_path.replace(/^\\$res:/, \"\")\n    );","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/utils.ts#L229-L265","documentation":"`selectRepository` is the shared git-sync repository picker in the windmill CLI. It throws this when the workspace has zero git-sync repositories, so there is nothing to select for the requested operation (pull/push/etc.).","triggerScenarios":"Running a git-sync command (e.g. repository auto-selection via `selectAndLogRepository`) against a workspace where no git-sync repositories have been created.","commonSituations":"Pointing the CLI at a fresh/empty workspace or the wrong workspace/URL; repositories not yet set up in the UI; credentials landing on a workspace without repos.","solutions":["Create a git-sync repository in the Windmill UI (Workspace → Git sync) first","Verify you are targeting the intended workspace (`wmill workspace list` / `--workspace` flag)","Check that your token's workspace matches the one containing the repositories"],"exampleFix":"// before\nwmill git-sync pull  # against empty workspace\n// No git-sync repositories configured in workspace\n// after: create the repo in Workspace Settings → Git Synchronization, then\nwmill git-sync pull","handlingStrategy":"validation","validationCode":"const repos = await client.listGitSyncRepositories(); // or check config before running\nif (!repos || repos.length === 0) {\n  console.error('No git-sync repositories in this workspace; create one in Workspace Settings first.');\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runGitSyncCommand();\n} catch (e) {\n  if (e.message === 'No git-sync repositories configured in workspace') {\n    console.error('Target workspace has no git-sync repos. Check workspace selection and create a repo in the UI.');\n  } else throw e;\n}","preventionTips":["Confirm the target workspace with `wmill workspace list` before sync commands","Create git-sync repositories in the UI before automating pull/push","In CI, assert the workspace is fully configured as a pre-flight step"],"tags":["cli","git-sync","workspace","configuration"],"backgroundTag":"no-repositories-configured","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}