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. - 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.