{"record":{"id":"b057e7cd3d8d4333","repo":"zed-industries/zed","slug":"no-git-repositories-found-in-the-project","errorCode":null,"errorMessage":"No git repositories found in the project","messagePattern":"No git repositories found in the project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_ui_core/src/worktree_service.rs","lineNumber":798,"sourceCode":"    // `detach_and_log_err`, matching the pre-existing silent return.\n    if workspace.active_worktree_creation().label.is_some() {\n        return Task::ready(Err(anyhow!(\"A worktree creation is already in progress\")));\n    }\n\n    let previous_state =\n        workspace.capture_state_for_worktree_switch(window, fallback_focused_dock, cx);\n    let workspace_handle = workspace.weak_handle();\n    let window_handle = window.window_handle().downcast::<MultiWorkspace>();\n    let remote_connection_options = project.read(cx).remote_connection_options(cx);\n\n    let (git_repos, non_git_paths) = classify_worktrees(project.read(cx), cx);\n\n    if git_repos.is_empty() {\n        let toast_workspace = cx.entity();\n        show_error_toast(\n            toast_workspace,\n            \"worktree create\",\n            anyhow!(\"No git repositories found in the project\"),\n            cx,\n        );\n        return Task::ready(Err(anyhow!(\"No git repositories found in the project\")));\n    }\n\n    if remote_connection_options.is_some() {\n        let is_disconnected = project\n            .read(cx)\n            .remote_client()\n            .is_some_and(|client| client.read(cx).is_disconnected());\n        if is_disconnected {\n            let toast_workspace = cx.entity();\n            show_error_toast(\n                toast_workspace,\n                \"worktree create\",\n                anyhow!(\"Cannot create worktree: remote connection is not active\"),\n                cx,\n            );","sourceCodeStart":780,"sourceCodeEnd":816,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git_ui_core/src/worktree_service.rs#L780-L816","documentation":"Guard in create_worktree_workspace_inner: classify_paths found no git repositories (and only non-git content) in the project, so there is no repository in which a worktree can be created. A toast is shown alongside the returned error.","triggerScenarios":"Thrown at crates/git_ui_core/src/worktree_service.rs:798 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open a folder that is a git repository (contains a .git directory)","Initialize one with `git init` in the project root, then reload the project","If the repo is in a subdirectory, ensure worktrees are scanned/registered by reopening that folder","For monorepos, verify the repository root is the opened workspace root or a registered worktree"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}