git-merge-linear

Merge a task branch into main with a linear history and verification.

4|Updated Sep 25, 2025
One-click install
npx skills add https://github.com/cowwoc/styler --skill git-merge-linear
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-merge-linear
Source: https://github.com/cowwoc/styler/tree/main/.claude/skills/git-merge-linear
Command: npx skills add https://github.com/cowwoc/styler --skill git-merge-linear

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git.

What problem does it solve?

Merging feature or task branches into main can often introduce messy merge commits, complicating the Git history and making debugging or future reverts harder. Ensuring a clean, linear history requires careful validation and specific Git commands that are easy to misuse. This Skill automates the process for a pristine main branch.

Core Features & Use Cases

  • Pre-Merge Validation: Automatically verifies that the task branch is ready for merge (e.g., exactly one squashed commit, current branch is main), preventing common merge errors.
  • Fast-Forward Merge: Executes a --ff-only merge to guarantee a linear history, preventing unnecessary merge commits and keeping the commit graph clean.
  • Post-Merge Verification: Confirms that the history remains linear and that the correct commit has been added to main, ensuring the merge was successful and as intended.
  • Use Case: After completing a feature on a task branch and squashing all commits into one, you need to merge it into main. This Skill ensures the merge is clean, linear, and validated, preventing accidental non-fast-forward merges or merging an un-squashed history, saving you from Git headaches.

Quick Start

From the 'main' branch, use the git-merge-linear skill to merge the 'implement-formatter-api' task branch.

Frequently Asked Questions about git-merge-linear

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

FAQPage Schema
How do I merge a Git branch with a clean, linear history?

Fast-forward merge your task branch into main using `--ff-only` to preserve a linear history without merge commits. This Skill automates validation, executes the merge safely, and verifies the result remains clean and auditable.

What's the best way to merge a feature branch into main without creating merge commits?

Squash your feature branch into a single commit, then use fast-forward merge to integrate it into main. This Skill enforces one-commit prerequisites and validates linearity before and after merge, preventing accidental non-fast-forward merges.

How do I ensure my Git merge doesn't break project history requirements?

Pre-merge verification confirms your task branch is ready—exactly one commit, current branch is main—then fast-forward merge executes, and post-merge validation confirms history linearity and correct commit addition to main.

Can I automate Git merges while keeping the commit history clean?

Yes. This Skill automates the entire merge workflow: pre-merge checks, fast-forward merge execution, post-merge verification, and optional branch cleanup, ensuring clean history without manual Git command risks.

What happens if my task branch has multiple commits before merging to main?

The Skill requires exactly one squashed commit per task branch before merge. If multiple commits exist, squash them first, then use this workflow to safely merge with linear history preserved.