Skip to main content
Branch actions allow you to manage Git branches directly from the graph view. These operations modify the repository’s branch structure and can switch your working directory to different branches.

Create Branch

Create a new branch from a specific commit. Command: createBranch

Parameters

ParameterTypeRequiredDescription
repostringYesPath to the Git repository
commitHashstringYesHash of the commit where the branch will be created
branchNamestringYesName for the new branch

Implementation

Executes: git branch <branchName> <commitHash>

Response

Returns a status indicating success (null) or an error message if the operation failed.

Checkout Branch

Switch to an existing branch or create and checkout a remote branch. Command: checkoutBranch

Parameters

ParameterTypeRequiredDescription
repostringYesPath to the Git repository
branchNamestringYesName of the branch to check out
remoteBranchstring | nullYesIf provided, creates a new local branch tracking this remote branch

Implementation

  • Local branch: git checkout <branchName>
  • Remote branch: git checkout -b <branchName> <remoteBranch>

Response

Returns a status indicating success (null) or an error message if the operation failed.

Delete Branch

Delete a branch from the repository. Command: deleteBranch

Parameters

ParameterTypeRequiredDescription
repostringYesPath to the Git repository
branchNamestringYesName of the branch to delete
forceDeletebooleanYesIf true, force deletion even if the branch has unmerged changes

Implementation

  • Normal delete: git branch --delete <branchName>
  • Force delete: git branch --delete --force <branchName>

Response

Returns a status indicating success (null) or an error message if the operation failed.
Force deleting a branch will permanently remove it even if it contains unmerged work.

Rename Branch

Rename an existing branch. Command: renameBranch

Parameters

ParameterTypeRequiredDescription
repostringYesPath to the Git repository
oldNamestringYesCurrent name of the branch
newNamestringYesNew name for the branch

Implementation

Executes: git branch -m <oldName> <newName>

Response

Returns a status indicating success (null) or an error message if the operation failed.

Merge Branch

Merge a branch into the current branch. Command: mergeBranch

Parameters

ParameterTypeRequiredDescription
repostringYesPath to the Git repository
branchNamestringYesName of the branch to merge
createNewCommitbooleanYesIf true, always create a merge commit (uses --no-ff)

Implementation

  • Fast-forward merge: git merge <branchName>
  • Force merge commit: git merge <branchName> --no-ff

Response

Returns a status indicating success (null) or an error message if the operation failed.
Setting createNewCommit to true prevents fast-forward merges and always creates a merge commit, preserving the branch history.

Build docs developers (and LLMs) love