git-branches
Manage Git branch lifecycle with create, list, delete, merge, and compare operations. Includes safety warnings for destructive actions like branch deletion to protect commit history.
Instructions
Git branch management tool for branch lifecycle operations. Supports create, list, get, delete, merge, and compare operations. Includes safety warnings for destructive operations like branch deletion.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | The branch operation to perform. WARNING: delete operation permanently removes branches and their commit history. | |
baseBranch | No | Base branch for comparison (required for compare action) | |
branchName | No | Name of the branch (required for create, get, delete, merge) | |
checkout | No | Checkout branch after creation (for create action) | |
compareBranch | No | Branch to compare against base (required for compare action) | |
force | No | Force operation (for delete, merge actions) | |
owner | No | Repository owner (for remote operations) | |
projectPath | Yes | Absolute path to the project directory | |
provider | No | Provider for remote operations (if supported) | |
remote | No | Remote name (default: origin) | |
repo | No | Repository name (for remote operations) | |
sourceBranch | No | Source branch to create from (for create action) | |
targetBranch | No | Target branch to merge into (for merge action) |
Input Schema (JSON Schema)
{
"properties": {
"action": {
"description": "The branch operation to perform. WARNING: delete operation permanently removes branches and their commit history.",
"enum": [
"create",
"list",
"get",
"delete",
"merge",
"compare"
],
"type": "string"
},
"baseBranch": {
"description": "Base branch for comparison (required for compare action)",
"type": "string"
},
"branchName": {
"description": "Name of the branch (required for create, get, delete, merge)",
"type": "string"
},
"checkout": {
"description": "Checkout branch after creation (for create action)",
"type": "boolean"
},
"compareBranch": {
"description": "Branch to compare against base (required for compare action)",
"type": "string"
},
"force": {
"description": "Force operation (for delete, merge actions)",
"type": "boolean"
},
"owner": {
"description": "Repository owner (for remote operations)",
"type": "string"
},
"projectPath": {
"description": "Absolute path to the project directory",
"type": "string"
},
"provider": {
"description": "Provider for remote operations (if supported)",
"enum": [
"github",
"gitea",
"both"
],
"type": "string"
},
"remote": {
"description": "Remote name (default: origin)",
"type": "string"
},
"repo": {
"description": "Repository name (for remote operations)",
"type": "string"
},
"sourceBranch": {
"description": "Source branch to create from (for create action)",
"type": "string"
},
"targetBranch": {
"description": "Target branch to merge into (for merge action)",
"type": "string"
}
},
"required": [
"action",
"projectPath"
],
"type": "object"
}