Skip to main content
Glama
uneco
by uneco

unstack

Transform linear commit histories into parallel branches for separate pull requests. Organize sequential changes into independent branches that can be reviewed and merged individually.

Instructions

Unstack linear commits into parallel branches for separate PRs.

This tool transforms a linear commit history (A -> B -> C -> D) into parallel branches (A -> B, A -> C, A -> D) where each branch contains specific commits cherry-picked from the original history.

Use this when you've made multiple changes in sequence but want to create separate PRs for different logical changes. Each branch can be independently reviewed and merged.

Example scenario: You have commits: fix-bug -> add-feature -> update-docs You want separate PRs, so you create:

  • feat/999: [fix-bug, update-docs]

  • feat/1000: [add-feature]

This creates two branches from origin/main:

  • feat/999 with fix-bug and update-docs cherry-picked in order

  • feat/1000 with add-feature cherry-picked

Args: branches: Dictionary mapping branch names to lists of commit references. Commits can be specified as SHA, branch names, or symbolic refs (e.g., HEAD~2). Commits are cherry-picked in the order specified. parent: Base commit to branch from (default: "origin/main"). All branches will start from this commit.

Returns: JSON string with format: { created_branches: [{name, commits_applied, head_sha}], errors: [{branch, commit, error}], stats: {total_branches, successful_branches, failed_branches} }

Note: - Existing branches with the same name will cause an error - The current branch is not changed by this operation - Uses low-level git commands (commit-tree, update-ref) to avoid changing working directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchesYes
parentNoorigin/main

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/uneco/mcp-git-polite'

If you have feedback or need assistance with the MCP directory API, please join our Discord server