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
originremote. - fetch_
with_ 🔒repo - Fetches branches using a pre-discovered repository, avoiding redundant filesystem walks.
- 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.
- get_
previous - Returns the name of the previously checked-out branch (
@{-1}), if any. - 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.