diff --git a/cli/src/core/git.py b/cli/src/core/git.py index 17638b2..8ca7b40 100644 --- a/cli/src/core/git.py +++ b/cli/src/core/git.py @@ -38,6 +38,14 @@ def git_push_changes( logger.info(f"Git Operation Failed: {e}") +def delete_local_branch(repo: git.Repo, branch_name: str): + """ + Delete local branch if it already exists + """ + logger.info(f"Deleting local branch '{branch_name}'...") + repo.git.branch("-D", branch_name) + + def switch_branch(repo: git.Repo, branch_name: str): """ Create branch if it doesn't exist, then checkout