create-worktree

Create a git worktree for a specified branch in the ClickHouse repository.

1|Updated Jul 29, 2024
One-click install
npx skills add https://github.com/codacy-open-source-projects-scans/clickhouse --skill create-worktree-codacy-open-source-projects-scans
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-worktree
Source: https://github.com/codacy-open-source-projects-scans/clickhouse/tree/main/.claude/skills/create-worktree
Command: npx skills add https://github.com/codacy-open-source-projects-scans/clickhouse --skill create-worktree-codacy-open-source-projects-scans

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of setting up isolated development environments for the ClickHouse project, enabling efficient parallel development on different branches without impacting the main codebase or requiring excessive disk space.

Core Features & Use Cases

  • Isolated Worktrees: Creates a new, independent git worktree for a specified branch.
  • Submodule Optimization: Utilizes hardlinks to share submodule Git data from the main repository, saving disk space and avoiding network cloning.
  • Use Case: A developer needs to work on a new feature (feature/new-analytics) and simultaneously fix a bug in a release branch (release/25.12). This Skill allows them to create two separate worktrees, each with its own branch and optimized submodule setup, allowing them to switch contexts seamlessly.

Quick Start

Create a new git worktree for the 'my-feature' branch, placing it in a sibling directory to the current repository.

Frequently Asked Questions about create-worktree

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

FAQPage Schema
How do I create a git worktree for ClickHouse development without duplicating submodule data?

Creating a git worktree for ClickHouse can use hardlinks to share submodule Git objects from the main repository, avoiding redundant disk usage and network access. This approach sets up an isolated development environment efficiently.

What is the best way to manage multiple ClickHouse feature branches simultaneously?

Git worktrees provide the best way to manage multiple ClickHouse branches by creating isolated working directories for each branch. This allows seamless context switching between features without impacting the main codebase.

Can I checkout an existing branch into a new ClickHouse worktree?

Yes, you can checkout an existing branch or create a new one when setting up a ClickHouse worktree. The process supports user-guided destination path selection to place the worktree in your preferred directory.

Does hardlinking submodules in git worktrees actually save disk space?

Hardlinking submodules in git worktrees saves disk space by sharing submodule Git data from the main repository. This avoids network cloning and redundant local storage of identical objects across multiple worktrees.

Why should I use worktrees instead of cloning the ClickHouse repository multiple times?

Worktrees are more efficient than multiple clones because they share the main repository's Git objects and use hardlinks for submodules. This avoids network access, saves disk space, and simplifies branch management.