The rust-langrust repository uses git submodules as a way to use other rust projects from within the rust repo. Examples include rusts fork of llvm-project, cargo and libraries like stdarch and backtrace. Those projects are developed and maintained in an separate git (and github) repository, and they have their own git historycommits, issue tracker and prs. Git в rust для работы с git в rust необходимо сначала установить библиотеку git2-rs. Git является одним из наиболее распространенных систем контроля версий в мире программирования. Rust это молодой и быстро растущий язык программирования с уникальными особенностями, которые делают его очень популярным среди разработчиков.
There are bindings to libgit2 in many languages, but were interested primarily in rust, right? The git2 crate provides safe rust bindings. Just like most of our work with git happens in a repository, our interaction with git2 starts with a repository struct. This type has a few associated functions (aka static methods) to create a value of the type. Among those are clone() or init() which correspond to git subcommands, but were going to use open() in the example. Extern crate git2 use git2repository the repository is the source from which almost all other objects in git-rs are spawned. The init method will create a new repository, assuming one does not already exist.
Use git2repository let repo match repositoryinit(pathtoarepo) ok(repo) repo, err(e) panic!(failed to init , e), opening an existing repository. Use git2repository my end goal is to link rust to my custom built llvm-git system compiler. But as i am a novice with the rust toolchain, their totally different build process is causing me a lot of headaches, hence i cannot rule out user error. Gitoxide is an implementation of git written in rust for developing future-proof applications which strive for correctness and performance while providing a pleasant and unsurprising developer experience. The above can be hard to answer and this paragraph is here to help with feature discovery.
Md for a rather exhaustive document that contains both implemented and planned features. Further, the gix crate documentation with the git2 search term helps to find all currently known git2 equivalent method calls. Pure rust rather than bindings to a c library, making for easier cross-compilation. Works with gits ssh agent on windows (libssh, which is used by git2-rs is unable to at present, making using ssh not possible on windows). .