Skip to main content

checkout

Function checkout 

Source
pub fn checkout(dir: &Path, branch: &str) -> Result<(), String>
Expand description

Check out an existing branch (git switch <branch>). Returns Ok(()) on success, or the captured stderr on failure (e.g. a conflicting dirty tree).

ยงErrors

Returns the trimmed stderr text when git switch exits non-zero or cannot run.