astral-sh/uv · error
`git` not found in PATH
Error message
`git` not found in PATH
What it means
Error "`git` not found in PATH" thrown in astral-sh/uv.
Source
Thrown at crates/uv/src/commands/project/init.rs:1288
/// Currently, this only tries to get the author information from git.
fn get_author_info(path: &Path, author_from: AuthorFrom) -> Option<Author> {
if matches!(author_from, AuthorFrom::None) {
return None;
}
if matches!(author_from, AuthorFrom::Auto | AuthorFrom::Git) {
match get_author_from_git(path) {
Ok(author) => return Some(author),
Err(err) => warn!("Failed to get author from git: {err}"),
}
}
None
}
/// Fetch the default author from git configuration.
fn get_author_from_git(path: &Path) -> Result<Author> {
let Ok(git) = GIT.as_ref() else {
anyhow::bail!("`git` not found in PATH")
};
let mut name = None;
let mut email = None;
let output = git
.build_command()
.arg("config")
.arg("--get")
.arg("user.name")
.current_dir(path)
.stdout(Stdio::piped())
.stderr(Stdio::null())
.output()?;
if output.status.success() {
name = Some(String::from_utf8_lossy(&output.stdout).trim().to_string());
}
View on GitHub (pinned to f1a42680ff)
When it happens
Trigger: Thrown at crates/uv/src/commands/project/init.rs:1288 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of astral-sh/uv@f1a42680ff (2026-08-16).
Data as JSON: /api/errors/1345ddd51fc19b00.
Report an issue: GitHub.