Thanks to visit codestin.com
Credit goes to lib.rs

Cargo Features

git2 has no features set by default.

[dependencies]
git2 = { version = "0.21.0", features = ["unstable", "unstable-sha256", "ssh", "https", "cred", "vendored-libgit2", "vendored-openssl", "zlib-ng-compat"] }
unstable
unstable-sha256

Experimental SHA256 OID support, reflecting upstream libgit2's GIT_EXPERIMENTAL_SHA256.

This is an ABI-breaking change. Future releases with this feature may introduce breakages without notice Use at your own risk.

Library authors: DO NOT enable this feature by default in your dependencies. Due to Cargo's additive features, downstream users cannot deactivate it once enabled.

NOTE: libgit2's builtin SHA256 implementation is not thread-safe. Enable the https feature to route hashing through thread-safe OpenSSL impl. See https://github.com/rust-lang/git2-rs/issues/1255.

Enables unstable-sha256 of libgit2-sys

Affects test::repo_init_sha256

ssh = cred

Enables ssh of libgit2-sys

https = cred, openssl-probe, openssl-sys

Enables https of libgit2-sys

cred https? ssh?

Include support for credentials, which pulls in the url crate and all its dependencies

Enables url

Affects cred::CredentialHelper

vendored-libgit2

Enables vendored of libgit2-sys

vendored-openssl

Enables vendored-openssl of libgit2-sys, vendored of openssl-sys

zlib-ng-compat

Enables zlib-ng-compat of libgit2-sys

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

openssl-probe unix not mac https?

Enables openssl-probe ^0.1

openssl-sys unix not mac https? vendored-openssl?