MCP HubMCP Hub
Zurück zu Fähigkeiten

git-sync-manager-5-safe-branch-operations

vamseeachanta
Aktualisiert Yesterday
4 Ansichten
3
2
3
Auf GitHub ansehen
Anderegeneral

Über

Diese Claude-Fähigkeit ermöglicht sicheres Branch-Wechseln über Git-Repositories hinweg, indem sie vor Operationen die Existenz von Branches prüft und auf unkommittierte Änderungen untersucht. Sie verhindert Datenverlust, indem Branch-Wechsel blockiert werden, solange ausstehende Änderungen vorliegen. Entwickler sollten diese Teilfähigkeit beim Verwalten mehrerer Repositorys nutzen, um konsistente und geschützte Branch-Übergänge zu gewährleisten.

Schnellinstallation

Claude Code

Empfohlen
Primär
npx skills add vamseeachanta/workspace-hub
Plugin-BefehlAlternativ
/plugin add https://github.com/vamseeachanta/workspace-hub
Git CloneAlternativ
git clone https://github.com/vamseeachanta/workspace-hub.git ~/.claude/skills/git-sync-manager-5-safe-branch-operations

Kopieren Sie diesen Befehl und fügen Sie ihn in Claude Code ein, um diese Fähigkeit zu installieren

Dokumentation

5. Safe Branch Operations

5. Safe Branch Operations

Switch branches safely across repositories:

#!/bin/bash
# ABOUTME: Safe branch switching across repositories
# ABOUTME: Validates branch existence and checks for uncommitted changes

switch_branch() {
    local repo="$1"
    local target_branch="$2"

    if [[ ! -d "$repo/.git" ]]; then
        echo "skip: not a git repo"
        return 1
    fi

    cd "$repo" || return 1

    # Check for uncommitted changes
    if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then
        echo "blocked: uncommitted changes"
        return 1
    fi

    # Check if branch exists locally
    if git show-ref --verify --quiet "refs/heads/$target_branch" 2>/dev/null; then
        git checkout "$target_branch" 2>/dev/null
        echo "switched: local branch"
        return 0
    fi

    # Check if branch exists remotely
    if git show-ref --verify --quiet "refs/remotes/origin/$target_branch" 2>/dev/null; then
        git checkout -b "$target_branch" "origin/$target_branch" 2>/dev/null
        echo "switched: created from remote"
        return 0
    fi

    echo "skip: branch not found"
    return 1
}

# Batch branch switch
batch_switch_branch() {
    local target_branch="$1"
    shift
    local repos=("$@")

    echo "Switching to branch: $target_branch"
    echo ""

    for repo in "${repos[@]}"; do
        echo -n "→ $repo: "
        switch_branch "$repo" "$target_branch"
    done
}

GitHub Repository

vamseeachanta/workspace-hub
Pfad: .claude/skills/_core/bash/git-sync-manager/5-safe-branch-operations

Verwandte Skills

algorithmic-art

Meta

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

Skill ansehen

subagent-driven-development

Entwicklung

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

Skill ansehen

executing-plans

Design

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

Skill ansehen

cost-optimization

Andere

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

Skill ansehen