Pure-rust Git Client
Example: Cloning, Committing
use *;
use create_ed25519_keypair;
let github_account_id = "john.doe@gmail.com";
let = create_ed25519_keypair;
println!;
// Add this public key to `authorized_keys` on your server
// -> https://github.com/settings/keys
let remote = new;
let mut repo = new;
let the_branch = "main";
// we don't need the full history
let clone_depth = Some;
// this will clone the branch via SSH
repo.clone.unwrap;
// enough with this library
repo.stage.unwrap;
// let's be nice with each other
repo.stage.unwrap;
let new_head = repo.commit.unwrap;
// this will update the branch via SSH
repo.push.unwrap;
Supported Git Protocols
- Clone: version 2 with optional
shallow
option. - Push: version 1 with
report-status
andthin-pack
options.
Future improvements
- Test against git servers others than Github
- Pack objects as RefDelta
fn Repository::log() -> impl Iterator<Item = Commit>
Feel free to submit pull requests for these.