- Notifications
You must be signed in to change notification settings - Fork423
libgit2 bindings for Rust
License
Apache-2.0, MIT licenses found
Licenses found
rust-lang/git2-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
libgit2 bindings for Rust.
[dependencies]git2 ="0.20.2"
git2-rs works with stable Rust, and typically works with the most recent priorstable release as well.
Currently this library requires libgit2 1.9.0 (or newer patch versions). Thesource for libgit2 is included in the libgit2-sys crate so there's no need topre-install the libgit2 library, the libgit2-sys crate will figure that and/orbuild that for you. On the other hand, if an appropriate version oflibgit2
is present,git2
will attempt to dynamically link it.
To be more precise, the vendoredlibgit2
is linked statically if twoconditions both hold:
- The environment variable
LIBGIT2_NO_VENDOR=1
isnot set - and either a) The Cargo feature
vendored-libgit2
is set or b) anappropriate version oflibgit2
cannot be found on the system.
In particular, note that the environment variable overrides the Cargo feature.
$ git clone https://github.com/rust-lang/git2-rs$cd git2-rs$ cargo build
Running tests and handling all of the associated edge cases on every commitproves tedious very quickly. To automate tests and handle proper stashing andunstashing of unstaged changes and thus avoid nasty surprises, use thepre-commit hook foundhere and place it into the.git/hooks/
with the namepre-commit
. You may need to add executionpermissions withchmod +x
.
To skip tests on a simple commit or doc-fixes, usegit commit --no-verify
.
If thessh
feature is enabled (and it is by default) then this library dependson libssh2 which depends on OpenSSL. To get OpenSSL working follow theopenssl
crate's instructions.
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE orhttps://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttps://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in git2-rs by you, as defined in the Apache-2.0 license, shall bedual licensed as above, without any additional terms or conditions.
About
libgit2 bindings for Rust
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Security policy
Uh oh!
There was an error while loading.Please reload this page.