Module branch

Module branch 

Source
Expand description

Branch operations for Git repositories.

Provides functions for retrieving default and current branch names, creating new branches, switching branches, fetching branches from remotes, and listing all branches with metadata.

Enums§

Branch
Local or remote branch with metadata about the last commit.

Functions§

create_from_default_branch
Create a new local branch at current HEAD (no checkout).
fetch
Fetches the specified branch names from the origin remote.
get_all
Fetches all branches from the ‘origin’ remote and returns all local and remote Branches sorted by last committer date (most recent first).
get_all_no_redundant
Retrieves all branches without redundant remote duplicates.
get_current
Get current branch name (fails if HEAD detached).
get_default
Retrieves the default branch name from the Git repository.
push
Pushes a branch to the default remote.
remove_redundant_remotes
Removes remote branches that have a corresponding local branch of the same shortened name.
switch
Checkout a branch or detach HEAD; supports previous branch shorthand and branch creation via guessing.