{"record":{"id":"1345ddd51fc19b00","repo":"astral-sh/uv","slug":"git-not-found-in-path","errorCode":null,"errorMessage":"`git` not found in PATH","messagePattern":"`git` not found in PATH","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/project/init.rs","lineNumber":1288,"sourceCode":"/// Currently, this only tries to get the author information from git.\nfn get_author_info(path: &Path, author_from: AuthorFrom) -> Option<Author> {\n    if matches!(author_from, AuthorFrom::None) {\n        return None;\n    }\n    if matches!(author_from, AuthorFrom::Auto | AuthorFrom::Git) {\n        match get_author_from_git(path) {\n            Ok(author) => return Some(author),\n            Err(err) => warn!(\"Failed to get author from git: {err}\"),\n        }\n    }\n\n    None\n}\n\n/// Fetch the default author from git configuration.\nfn get_author_from_git(path: &Path) -> Result<Author> {\n    let Ok(git) = GIT.as_ref() else {\n        anyhow::bail!(\"`git` not found in PATH\")\n    };\n\n    let mut name = None;\n    let mut email = None;\n\n    let output = git\n        .build_command()\n        .arg(\"config\")\n        .arg(\"--get\")\n        .arg(\"user.name\")\n        .current_dir(path)\n        .stdout(Stdio::piped())\n        .stderr(Stdio::null())\n        .output()?;\n    if output.status.success() {\n        name = Some(String::from_utf8_lossy(&output.stdout).trim().to_string());\n    }\n","sourceCodeStart":1270,"sourceCodeEnd":1306,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/project/init.rs#L1270-L1306","documentation":"Error \"`git` not found in PATH\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/project/init.rs:1288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}