git_branch
List, create, or delete Git branches to manage feature work. Review existing branches, start new features, or remove merged ones with confirmation.
Instructions
List, create, or delete branches, marking the current branch with '*'. Use this to review existing branches before choosing where to work, to start a feature branch, or to remove a merged one; in detached HEAD state no branch is current. Does NOT switch branches — use git_checkout for that; does NOT manage release markers — use git_tag. Best for: managing feature branches and listing local or remote branches. Returns: branch listing lines, or confirmation text for create/delete; delete requires confirmed=True and refuses the current branch; force=True replaces an existing branch on create; 'list' with all=True also shows remote branches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Include remote branches in the listing | |
| name | No | Branch name | |
| force | No | Force delete a branch or force-create a branch | |
| confirmed | No | Explicit confirmation for branch deletion | |
| operation | No | One of: list, create, delete | list |
| repo_path | No | Path to the git repository, defaults to '.' (the server working directory) | . |