Skip to main content

delete_local_branch

Function delete_local_branch 

Source
pub async fn delete_local_branch(branch: &str, force: bool) -> Result<()>
Expand description

Delete a local git branch.

Uses git branch -d <branch> for merged branches, or git branch -D <branch> if force is true.

§Errors

Returns an error if:

  • The git command fails
  • The branch does not exist
  • The branch is not fully merged (unless force is true)
  • The branch is currently checked out