Skip to content
cccskills
FreePublished on GitHub

ls-git-merge-rebase

Advanced git operations beyond add/commit/push. Use when rebasing, bisecting bugs, using worktrees for parallel development, recovering with reflog, managing subtrees/submodules, resolving merge conflicts, cherry-picking across branches, or working with monorepos.

The English summary is being prepared. Showing the original description.

See how to install

Files included (5)

  • SKILL.md4.3 KB
  • references/rebase-and-bisect.md3.1 KB
  • references/repo-structure-and-conflicts.md4.4 KB
  • references/tags-releases-and-tips.md1.7 KB
  • references/worktrees-recovery-and-history.md4.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Git Workflows

Use this skill for advanced Git operations that can rewrite history, move work between branches, recover lost commits, or manage large and multi-repository codebases. Keep this file as the activation and safety workflow; open the references only for the procedure you need.

When to Use

  • Cleaning up commit history before merging.
  • Finding which commit introduced a bug.
  • Working on multiple branches at the same time.
  • Recovering lost commits, dropped stashes, or mistaken resets.
  • Cherry-picking commits across branches or forks.
  • Managing subtrees, submodules, or sparse checkouts.
  • Resolving complex merge or rebase conflicts.
  • Inspecting history with blame, pickaxe, or file-following log commands.

Safety Workflow

  1. Inspect the repository before changing it:
git status --short --branch
git remote -v
git branch --show-current
  1. Identify whether the target branch is shared. Do not rebase, amend, reset, or force-push shared history unless the user explicitly asks for that operation.
  2. Preserve unrelated work. If the worktree is dirty, only stage or modify files that belong to the task.
  3. Before every git reset --hard, require a clean worktree. Preserve desired staged, unstaged, and relevant untracked work first with an approved WIP commit, patch, stash (use -u when needed), or separate worktree. A backup branch or tag preserves only commits; it does not preserve uncommitted work.
git status --short
git stash push -u -m "WIP before recovery"
git branch backup/before-recovery
  1. Prefer non-interactive commands when automating. Use interactive rebase only when the user can review the intended commit list or the change is clearly local and scoped.
  2. After each operation, re-check status and confirm the branch, staged files, and diff match the requested outcome.

Rule ownership

This skill owns advanced Git operations and traceability behavior. GIT_TRACEABILITY.md is the public reference; use this skill for branch, history, worktree, release-tag, and checkpoint decisions.

  • Preserve unrelated dirty-tree work.
  • Record commit hashes or branch names when a decision depends on a past state.
  • Use ls-git-broken-state-recovery for broken worktree/index/ref symptoms instead of improvising repair steps here.

Workflow Router

Open the matching reference and follow only that recipe:

Quick Triage

Use these read-only commands before selecting a recipe:

git log --oneline --decorate --graph -20
git diff --stat
git diff --cached --stat
git reflog --date=relative -20

For branch divergence:

git fetch --all --prune
git status --short --branch
git log --oneline --left-right --cherry-pick HEAD...@{upstream}

If an operation is already in progress, inspect Git's state before continuing:

git status
git rebase --show-current-patch
git diff --cc

Completion Checks

  • git status --short --branch shows the expected branch and worktree state.
  • git diff --stat and git diff --cached --stat match the task scope.
  • Any rewritten or moved commits were verified with git log --oneline --graph.
  • Recovery work leaves a named branch or clear reflog handle for rollback when the operation could discard reachable work.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Guide accessibility reviews for UI, documents, and workflows. Use for WCAG-oriented audits, keyboard review, semantics, contrast, and remediation planning.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

Use when choosing a LocalSetup Agent-* lane for exploration, research, bounded implementation, or review. Consult the static capability matrix; do not probe account or network availability.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

Guide agent email inbox workflows with prompt-injection defenses. Use for inbound email processing, webhooks, routing, and safety review.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

Navigate and understand codebases using agentlens hierarchical documentation. Use when exploring new projects, finding modules, locating symbols in large files, finding TODOs/warnings, or understanding code structure.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

Use for Agent Q signed encrypted file-drop or mail ship and ingest, private registry v2 setup, queue status, and transport maintenance.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

Inventory wrapper for the alirezarezvani Claude skills bundle. Use when triaging its broad skill catalog and large script surface before any targeted import.

The English summary is being prepared. Showing the original description.

CruxExperts/LocalSetup6Updated Oct 21, 2026

See all skills by CruxExperts

Report a problem with this skill