{"record":{"id":"db2fa6b1f382ba31","repo":"gitbutlerapp/gitbutler","slug":"the-repository-at-is-bare-gitbutler-requires-a","errorCode":null,"errorMessage":"The repository at {} is bare. GitButler requires a non-bare repository.","messagePattern":"The repository at (.+?) is bare\\. GitButler requires a non-bare repository\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/setup.rs","lineNumber":242,"sourceCode":"        gitbutler_project::AddProjectOutcome::AlreadyExists(_) => {\n            if let Some(out) = out.for_human() {\n                writeln!(\n                    out,\n                    \"  {}\",\n                    t.success.paint(\"✓ Repository already in project registry\")\n                )?;\n            }\n            Ok(ProjectStatus::AlreadyExists)\n        }\n        gitbutler_project::AddProjectOutcome::PathNotFound => Err(anyhow::anyhow!(\n            \"The path {} does not exist\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NotADirectory => Err(anyhow::anyhow!(\n            \"The path {} is not a directory\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::BareRepository => Err(anyhow::anyhow!(\n            \"The repository at {} is bare. GitButler requires a non-bare repository.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NonMainWorktree => Err(anyhow::anyhow!(\n            \"The repository at {} is a non-main worktree. GitButler requires the main worktree.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NoWorkdir => Err(anyhow::anyhow!(\n            \"The repository at {} has no working directory. GitButler requires a working directory.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NoDotGitDirectory => Err(anyhow::anyhow!(\n            \"The repository at {} has no .git directory. GitButler requires a .git directory.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::ReftableRefFormatUnsupported => Err(anyhow::anyhow!(\n            \"The repository at {} uses the currently unsupported reftable reference format.\",\n            repo_path.display()","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/setup.rs#L224-L260","documentation":"Raised while registering a repository: `gitbutler_project` detected a bare repository and returned `AddProjectOutcome::BareRepository`. Bare repositories have no working directory, and GitButler's workspace model (virtual branches over a worktree) fundamentally requires one, so the project is rejected with an explicit message.","triggerScenarios":"Running setup against a bare clone, e.g. `but setup /srv/git/project.git` or a path whose config has `bare = true` (typical for server-side/central repositories created with `git init --bare` or `git clone --bare`).","commonSituations":"Pointing tooling at the central server-side copy; using a bare mirror for backup/sync; automated scripts that glob `*.git` directories.","solutions":["Point setup at a non-bare checkout of the repository instead (a normal working clone)","If you only have the bare repo, create a working clone from it: `git clone /srv/git/project.git ~/work/project`","Confirm bareness first with `git -C /the/path rev-parse --is-bare-repository` (prints true)"],"exampleFix":"# before: bare repository, rejected\nbut setup /srv/git/project.git\n\n# after: use a non-bare working clone\ngit clone /srv/git/project.git ~/work/project\nbut setup ~/work/project","handlingStrategy":"validation","validationCode":"let repo = gix::open(&repo_path)?;\nif repo.is_bare() {\n    anyhow::bail!(\"repository is bare; register a non-bare working clone instead\");\n}","typeGuard":"fn is_bare(out: &gitbutler_project::AddProjectOutcome) -> bool {\n    matches!(out, gitbutler_project::AddProjectOutcome::BareRepository)\n}","tryCatchPattern":"match add_project(&repo_path) {\n    Ok(out) if is_bare(&out) => { /* clone a working copy and register that */ }\n    Ok(out) => { /* other outcomes */ }\n    Err(err) if err.to_string().contains(\"bare\") => { /* bare-repo guidance */ }\n    Err(err) => return Err(err),\n}","preventionTips":["Pre-check with `git rev-parse --is-bare-repository` before setup","Never register server-side `*.git` central repositories; always use a working clone","Keep automation from globbing bare mirrors as project candidates"],"tags":["rust","cli","setup","git","bare-repository"],"backgroundTag":"git-bare-repository","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}