Skip to main content

Module git

Module git 

Source
Expand description

Git operations.

Validates git repositories, lists branches, creates and removes worktrees, and derives worktree directory names from project and branch names.

Functions§

create_worktree
Creates a git worktree for the given branch.
list_branches
Lists all branches (local and remote), deduplicated, sorted, with remote prefixes stripped.
project_name
Derives the project name from the repository root path.
remove_worktree
Removes a git worktree at the given path.
validate_repo
Validates that the given path is inside a git repository.
worktree_dir_name
Builds the worktree directory name from a project name and branch.