Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

libgit2 bindings for Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

rust-lang/git2-rs

Documentation

libgit2 bindings for Rust.

[dependencies]git2 ="0.20.2"

Rust version requirements

git2-rs works with stable Rust, and typically works with the most recent priorstable release as well.

Version of libgit2

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 oflibgit2is present,git2 will attempt to dynamically link it.

To be more precise, the vendoredlibgit2 is linked statically if twoconditions both hold:

  • The environment variableLIBGIT2_NO_VENDOR=1 isnot set
  • and either a) The Cargo featurevendored-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.

Building git2-rs

$ git clone https://github.com/rust-lang/git2-rs$cd git2-rs$ cargo build

Automating Testing

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.

Building on macOS 10.10+

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.

License

This project is licensed under either of

at your option.

Contribution

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

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Security policy

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp