Available Functions
Core Branch Function
branch
Multi-purpose function for listing, creating, renaming, copying, or deleting branches using raw Git flags
Create and Delete Operations
createBranch
Create a new branch with existence validation
deleteBranch
Delete a branch with optional force flag
copyBranch
Copy an existing branch to a new name
List and Check Operations
listBranches
List all local branches
listAllBranches
List all branches (local and remote) with format options
listRemoteBranches
List remote-tracking branches
branchExists
Check if a local branch exists
currentBranch
Get the name of the current branch
getDefaultBranch
Get the repository’s default branch
Management Operations
renameBranch
Rename an existing branch
setBranchUpstream
Set the upstream tracking branch
resetBranchToHead
Reset a branch to HEAD
Common Use Cases
Creating a Feature Branch
Checking Branch Existence
Listing Branches
Type Definitions
BranchOptions
Options for thebranch function:
BranchListFormat
Format options forlistAllBranches:
BranchListResult
Return type forlistAllBranches varies based on format: