Git Branch
git_branchManage Git branches by listing, creating, deleting, or renaming them. View current branch status and filter by merge status or remote origin to organize repositories.
Instructions
Manage branches: list all branches, show current branch, create a new branch, delete a branch, or rename a branch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. | . |
| operation | No | The branch operation to perform. | list |
| name | No | Branch name for create/delete/rename operations. | |
| newName | No | New branch name for rename operation. | |
| startPoint | No | Starting point (commit/branch) for new branch creation. | |
| force | No | Force the operation, bypassing safety checks. | |
| all | No | For list operation: show both local and remote branches. | |
| remote | No | For list operation: show only remote branches. | |
| merged | No | For list operation: show only branches merged into HEAD (true) or specified commit (string). | |
| noMerged | No | For list operation: show only branches not merged into HEAD (true) or specified commit (string). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | Indicates if the operation was successful. | |
| operation | Yes | ||
| branches | No | List of branches (for list operation). | |
| currentBranch | No | Name of current branch. | |
| message | No | Success message for create/delete/rename operations. |