GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rust-lang/git2-rs: libgit2 bindings for Rust

BranchesTags
Open more actions menu

Latest commit

 

History

2,278 Commits
2,278 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
ci
ci
 
 
examples
examples
 
 
git2-curl
git2-curl
 
 
libgit2-sys
libgit2-sys
 
 
src
src
 
 
systest
systest
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
FUNDING.json
FUNDING.json
 
 
LICENSE-APACHE
LICENSE-APACHE
 
 
LICENSE-MIT
LICENSE-MIT
 
 
README.md
README.md
 
 
triagebot.toml
triagebot.toml
 
 

Repository files navigation

git2-rs

Documentation

libgit2 bindings for Rust.

cargo add git2

Features

By default, git2 includes support for working with local repositories, but does not include network support (e.g. cloning remote repositories). If you want to use features that require network support, you may need the "https" and/or "ssh" features. If you support user-provided repository URLs, you probably want to enable both.

cargo add git2 --features https,ssh

Rust version requirements

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

Version of libgit2

Currently this library requires libgit2 1.9.7 (or newer patch versions). The source for libgit2 is included in the libgit2-sys crate so there's no need to pre-install the libgit2 library, the libgit2-sys crate will figure that and/or build that for you. On the other hand, if an appropriate version of libgit2 is present, git2 will attempt to dynamically link it.

To be more precise, the vendored libgit2 is linked statically if two conditions both hold:

  • The environment variable LIBGIT2_NO_VENDOR=1 is not set
  • and either a) The Cargo feature vendored-libgit2 is set or b) an appropriate version of libgit2 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 commit proves tedious very quickly. You can use GitHub's automated CI to run the tests on your commit(s) if you do not run them locally.

Building on macOS 10.10+

If the ssh feature is enabled then this library depends on libssh2 which depends on OpenSSL. To get OpenSSL working follow the openssl crate's instructions.

License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in git2-rs by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

libgit2 bindings for Rust

docs.rs/git2

Resources

Readme

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

2.1k stars

Watchers

14 watching

Forks

461 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.