land-branch

Rebase a feature branch onto main and merge via pull request.

9|10|Updated Nov 15, 2025
One-click install
npx skills add https://github.com/jkomoros/community-patterns --skill land-branch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: land-branch
Source: https://github.com/jkomoros/community-patterns/tree/main/.claude/skills/land-branch
Command: npx skills add https://github.com/jkomoros/community-patterns --skill land-branch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Land a feature branch: pull from main, rebase the branch, create a PR, and merge it via rebase with automatic branch deletion. Use when ready to land a completed feature branch.

Core Features & Use Cases

  • Prerequisites: You should be on a feature branch with all changes committed and the feature ready to merge.
  • Step 1: Verify Branch State: Use ./scripts/verify-branch to ensure you’re not on main and there are no uncommitted changes.
  • Step 2: Pull and Rebase onto Main: Use ./scripts/rebase-main to fetch, rebase, and push with safe force.
  • Step 2.5: Check for Downstream Dependencies: If changes affect other patterns, automatically detect and warn about downstream imports.
  • Step 2.6: Update Pattern READMEs: Ensure related README.md files reflect changes.
  • PR & Merge: Create a PR and enable auto-delete on merge for clean history.

Quick Start

  1. Confirm ready branch: ./scripts/verify-branch
  2. Rebase onto main and push: ./scripts/rebase-main
  3. After successful rebase, create PR and enable auto-delete on merge.

Frequently Asked Questions about land-branch

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

FAQPage Schema
How do I land a feature branch with a clean rebase workflow?

Landing a feature branch involves pulling from main, rebasing your changes onto the latest main, and merging via rebase to maintain linear history. Use ./scripts/verify-branch to confirm you're on a feature branch with no uncommitted changes, then ./scripts/rebase-main to fetch, rebase, and safely force-push. Finally, create a PR with auto-delete on merge enabled.

What's the difference between rebasing and merging a branch?

Rebasing replays your commits on top of main, creating a linear history without merge commits. Merging creates a merge commit that preserves the branch history. This Skill uses rebase-based PR flow to keep your repository history clean and easier to read.

How do I resolve conflicts when rebasing onto main?

The ./scripts/rebase-main script handles the rebase process, which may require manual conflict resolution if your changes conflict with main. After resolving conflicts in your editor, stage the resolved files and continue the rebase. The script uses --force-with-lease to push safely after conflicts are resolved.

Can I automate branch deletion after merging?

Yes. When you create a PR, enable the auto-delete on merge option in your PR settings. This automatically removes the feature branch from the repository after the PR is successfully merged, keeping your branch list clean.

What do I need to do before landing a branch?

Ensure all your changes are committed to your feature branch and you're not on main. Verify that downstream dependencies—if your changes affect other patterns—are checked and related README.md files are updated before rebasing and creating the PR.

Why does landing require force-pushing with --force-with-lease?

Force-pushing with --force-with-lease is safe because it rejects the push if someone else has updated the remote branch since you last fetched. This prevents accidentally overwriting others' work while allowing you to rebase your feature branch onto main without being blocked by the diverged history.