workon
Core library for git-workon: an opinionated git worktree workflow tool.
Published on crates.io as git-workon-lib (library name: workon).
Usage
[]
= "0.1"
use ;
API docs
Full API documentation is on docs.rs.
Core library for git-workon: an opinionated git worktree workflow tool.
Published on crates.io as git-workon-lib (library name: workon).
[dependencies]
git-workon-lib = "0.1"
use workon::{get_repo, get_worktrees, add_worktree, BranchType};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let repo = get_repo(None)?;
// List all worktrees
for wt in get_worktrees(&repo)? {
println!("{}: {}", wt.name().unwrap_or("?"), wt.path().display());
}
// Create a new worktree
let wt = add_worktree(&repo, "my-feature", BranchType::Normal, None)?;
println!("Created worktree at {}", wt.path().display());
Ok(())
}
Full API documentation is on docs.rs.