38 breaking releases
| 0.51.0 | Apr 27, 2026 |
|---|---|
| 0.49.0 | Mar 22, 2026 |
| 0.45.0 | Dec 31, 2025 |
| 0.43.0 | Nov 22, 2025 |
| 0.16.2 | Mar 30, 2023 |
#1142 in Filesystem
2,159,777 downloads per month
Used in 619 crates
(13 directly)
465KB
9K
SLoC
Find git repositories or search them upwards from a starting point, or determine if a directory looks like a git repository.
Note that detection methods are educated guesses using the presence of files, without looking too much into the details.
Examples
let (path, _trust) = gix_discover::upwards(&nested)?;
let (repository_dir, worktree_dir) = path.into_repository_and_work_tree_directories();
assert_eq!(repository_dir, git_dir);
assert_eq!(worktree_dir, Some(dir.path().to_path_buf()));
assert!(gix_discover::is_git(&repository_dir).is_ok());
Dependencies
~10–17MB
~316K SLoC