{"record":{"id":"a86a9aeb6f491b86","repo":"windmill-labs/windmill","slug":"warning-in-a-git-repository-the-workspaces","errorCode":null,"errorMessage":"⚠️  WARNING: In a Git repository, the 'workspaces' section is recommended in wmill.yaml.\\n   Consider adding a workspaces section to map workspace names to Windmill instances.\\n   Run 'wmill init' to recreate the configuration file with proper workspace setup.","messagePattern":"⚠️  WARNING: In a Git repository, the 'workspaces' section is recommended in wmill\\.yaml\\.\\\\n   Consider adding a workspaces section to map workspace names to Windmill instances\\.\\\\n   Run 'wmill init' to recreate the configuration file with proper workspace setup\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/core/conf.ts","lineNumber":424,"sourceCode":"  const rawBranch = getCurrentGitBranch();\n\n  const originalBranchIfForked = getOriginalBranchForWorkspaceForks(rawBranch);\n\n  let currentBranch: string | null;\n  if (originalBranchIfForked) {\n    // The fork targeting itself is announced by tryResolveBranchWorkspace;\n    // this validation detail stays at debug to avoid a near-duplicate line.\n    log.debug(\n      `Workspace fork detected from branch name \\`${rawBranch}\\`. Validating workspace configuration using original branch \\`${originalBranchIfForked}\\``\n    );\n    currentBranch = originalBranchIfForked;\n  } else {\n    currentBranch = rawBranch;\n  }\n\n  // In a git repository, workspaces section is recommended\n  if (!workspaces || getWorkspaceNames(workspaces).length === 0) {\n    log.warn(\n      \"⚠️  WARNING: In a Git repository, the 'workspaces' section is recommended in wmill.yaml.\\n\" +\n        \"   Consider adding a workspaces section to map workspace names to Windmill instances.\\n\" +\n        \"   Run 'wmill init' to recreate the configuration file with proper workspace setup.\"\n    );\n    return;\n  }\n\n  // Warn if multiple workspaces map to the same git branch\n  const branchToWsNames = new Map<string, string[]>();\n  for (const name of getWorkspaceNames(workspaces)) {\n    const entry = workspaces[name] as WorkspaceEntryConfig;\n    const branch = getEffectiveGitBranch(name, entry);\n    const existing = branchToWsNames.get(branch);\n    if (existing) {\n      existing.push(name);\n    } else {\n      branchToWsNames.set(branch, [name]);\n    }","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/core/conf.ts#L406-L442","documentation":"The Windmill CLI (`wmill`) prints this warning from `validateBranchConfiguration` when `wmill push`, `pull`, or `push gitsync-settings` runs inside a git repository but the `wmill.yaml` config file has no `workspaces` section (or it defines zero workspaces). The workspaces section maps local workspace names to git branches and Windmill instances, which lets the CLI auto-detect which workspace to sync based on the current branch. It is a non-fatal advisory: the command continues, but branch-based auto-detection will not work.","triggerScenarios":"Running `wmill push`, `wmill pull`, or `wmill gitsync-settings push/pull` (without `--skip-branch-validation` or an explicit workspace override) while: (1) cwd is a git repository, (2) `wmill.yaml` exists but lacks a `workspaces:` key, or (3) the `workspaces` key exists but is empty or has no entries.","commonSituations":"Developers created `wmill.yaml` by hand with only top-level sync settings, initialized the repo before the workspaces feature existed, copied a minimal config from another project, or ran `wmill init` in a directory then stripped the workspaces section. Also common after cloning a repo whose `wmill.yaml` was gitignored.","solutions":["Run `wmill init` to regenerate `wmill.yaml` with a proper workspaces section (back up custom settings first).","Manually add a `workspaces:` section to `wmill.yaml` mapping workspace names to their git branches, e.g. `workspaces: { my-ws: { gitBranch: main } }`.","Use `wmill gitsync-settings pull` against an existing workspace to pull its git-sync configuration into the file.","If branch auto-detection is intentionally not needed, pass `--skip-branch-validation` or an explicit `--workspace` to silence the flow."],"exampleFix":"# before (wmill.yaml)\ninclude_scripts: true\ninclude_flows: true\n\n# after\ninclude_scripts: true\ninclude_flows: true\nworkspaces:\n  main:\n    gitBranch: main\n  staging:\n    workspace_id: staging-ws\n    gitBranch: develop","handlingStrategy":"validation","validationCode":"// before running wmill push/pull in CI or scripts\nconst cfg = await Deno.readTextFile(\"wmill.yaml\");\nif (!/^workspaces:\\s*$/m.test(cfg) || /^workspaces:\\s*\\{?\\s*\\}?\\s*$/m.test(cfg.trim())) {\n  console.warn(\"wmill.yaml has no workspaces section — run 'wmill init' or add one\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always bootstrap projects with `wmill init` so the workspaces section is generated.","Commit a `wmill.yaml` containing a workspaces mapping to the repo so every clone has it.","Lint `wmill.yaml` in CI for a non-empty `workspaces` key.","Don't strip the workspaces section when hand-editing the config."],"tags":["cli","git","configuration","windmill"],"backgroundTag":"missing-config-section","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"}