Registry / build-tool / git-version

git-version

JSON →
library0.3.9rscratesunverified

Compile the git version (tag name, or hash otherwise) and dirty state into your program.

# Cargo.toml [dependencies] git-version = "0.3.9"
INSTALL
IMPORT
SIG · GIT-VERSION
G
git-version
build-toolrustv0.3.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

git_version
✓ use git_version::git_version;

Prints the current git version at compile time.

use git_version::git_version; fn main() { let version = git_version!(); println!("Git version: {}", version); }
Debug
Known issues
gotchaRequires git to be installed and a git repository.
fix
Ensure the build environment has git and the project is in a git repo.
affects: >=0.3.0
Upgrade
Version history
0.3.9latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
git-version — cargo add git-version · libregistry