gt-split

Split a Git branch into multiple single-commit branches via interactive TUI.

2|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/cameronmaske/agent-stuff --skill gt-split
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gt-split
Source: https://github.com/cameronmaske/agent-stuff/tree/main/skills/gt-split
Command: npx skills add https://github.com/cameronmaske/agent-stuff --skill gt-split

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables software teams to transform a single branch containing large commits into multiple focused branches, improving PR clarity and rollback safety.

Core Features & Use Cases

  • Interactive, hunk-based splitting: Use a TUI to selectively stage changes by hunk or by file.
  • Plan-driven workflow: Preview and confirm a split plan before applying changes.
  • Post-split cleanup: Restore stashed changes, restack, and fix formatting on new branches.
  • Use Case: When a feature touches many files or large commits need to be decomposed into smaller PRs for focused reviews.

Quick Start

Run the interactive split by hunks on the current branch: EDITOR=vim GIT_EDITOR=vim gt split --by-hunk --no-verify

Frequently Asked Questions about gt-split

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I split a Git branch with large commits into multiple focused branches?

You can split a Git branch into multiple single-commit branches using an interactive TUI to selectively stage changes by hunk or file. This decomposes large commits into smaller, focused branches for cleaner PRs.

How does interactive hunk-based splitting work for decomposing Git commits?

Interactive hunk-based splitting uses a TUI to let you selectively stage specific code hunks or files from large commits. You preview and confirm a split plan before applying changes to create focused single-commit branches.

What is the best way to prepare large commits for clean PRs across multiple branches?

The best way to prepare large commits for clean PRs is using a plan-driven workflow that previews the split before applying changes, then runs post-split cleanup to restore stashed changes, restack branches, and fix formatting.

Do I need an active Git environment to split branches by hunks?

Yes, you need an active Git environment with stash and unstash steps to split branches by hunks. The process relies on the gt split tool in --by-hunk mode to interactively stage changes and restack new branches.

Can I selectively stage changes by file when splitting a Git branch?

Yes, you can selectively stage changes by file or by hunk when splitting a Git branch. The interactive TUI allows you to choose specific portions of large commits to extract into separate single-commit branches.

What happens to stashed changes after splitting a branch into focused commits?

After splitting a branch, post-split cleanup restores stashed changes, restacks the new branches, and fixes formatting. This ensures proper Git history and clean PRs without losing uncommitted work.