git-split-commit

Split a Git commit into separate atomic commits by hash.

2|Updated Nov 6, 2015
One-click install
npx skills add https://github.com/ahoym/dotfiles --skill git-split-commit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-split-commit
Source: https://github.com/ahoym/dotfiles/tree/main/.claude/commands/git-split-commit
Command: npx skills add https://github.com/ahoym/dotfiles --skill git-split-commit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you clean up your Git history by splitting a single commit that contains mixed changes into multiple, more focused commits. This makes your history easier to understand and manage.

Core Features & Use Cases

  • Split Recent Commit: Easily split the most recent commit on your branch.
  • Split Specific Commit: Split any commit by providing its hash.
  • Interactive Refinement: Guides you through selecting changes for each new commit.
  • Use Case: You accidentally committed both a feature implementation and documentation updates. Use this Skill to separate them into two distinct, logical commits.

Quick Start

Use the git split commit skill to split the most recent commit.

Frequently Asked Questions about git-split-commit

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

FAQPage Schema
How do I split a git commit containing mixed changes into separate commits?

To split a git commit, you reset to its parent commit, selectively stage the changes, and create multiple atomic commits to refactor your history. This process is guided interactively to ensure changes are grouped logically.

What is the best way to separate feature code and documentation updates in the same commit?

The best way to separate mixed changes like features and documentation is to split the git commit. This refactoring divides the changes into distinct, focused commits, making the history easier to understand and manage.

Can I split a specific older commit in git using its hash?

Yes, you can split a specific older commit by providing its commit hash. The process works by resetting to the target commit's parent, allowing you to selectively add and commit the changes into new atomic commits.

How does splitting a commit affect my version control history before a push?

Splitting a commit rewrites your version control history by replacing the original commit with multiple atomic commits. You can verify the new history before completing the process, ensuring the refactored history is correct.

Do I need to force push after splitting a recent commit?

Yes, splitting a recent commit rewrites your version control history, requiring a force push to update the remote repository. The process includes verifying the new history before you execute the force push.