本文へ移動
cccskills
無料GitHub で公開

git-rebase

Rebase the current branch onto a target branch using safety checks and an appropriate rebase strategy. Use when invoked as `$git-rebase` or when the user asks to update/rebase a branch.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md3.0 KB
  • agents/openai.yaml43 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

git-rebase

Rebase the current branch onto a target branch. If the user provides an argument, use it as the target branch; otherwise use the remote default branch.

Workflow

  1. Gather context:

    subject=$(git branch --show-current)
    target=<argument-or-default-branch>
    git status --porcelain=v1
    
  2. Stop if:

    • subject equals target.
    • The working tree is dirty. Tell the user to commit or stash first.
  3. Fetch remote-tracking refs without touching the local target branch:

    git fetch origin --prune
    target_ref="origin/${target}"
    

    Never use git fetch origin "${target}:${target}" for a branch that may be checked out in another worktree. If a local target branch must be updated, do that only in the worktree that currently has it checked out.

  4. Analyze divergence:

    merge_base=$(git merge-base HEAD "${target_ref}")
    git log --oneline "${merge_base}..HEAD"
    git log --oneline "${merge_base}..${target_ref}"
    git diff --name-only "${merge_base}" HEAD
    git diff --name-only "${merge_base}" "${target_ref}"
    git merge-base --is-ancestor "${merge_base}" "${target_ref}" && echo base_on_target=yes || echo base_on_target=no
    
  5. Choose strategy:

    ConditionStrategy
    Target has at least 20 commits and at least 3 overlapping filescherry-pick
    Merge-base is not on target lineagerebase --onto
    Otherwisesimple rebase

    Show the analysis and selected strategy before proceeding.

  6. Execute:

    • Simple: git rebase "${target_ref}"
    • Onto: git rebase --onto "${target_ref}" "${merge_base}" HEAD
    • Cherry-pick: create <subject>__cherrypick__ from target_ref and cherry-pick subject commits oldest-first.
  7. On conflicts, resolve automatically and continue; rerere makes this recoverable:

    • Apply any recorded rerere resolution.
    • Filtered machine-state files (e.g. .codex/*.config.toml trust hashes): keep ours (git checkout --ours); the clean filter re-normalizes the blob on git add.
    • Dependency/version bumps: keep the higher version, or --skip the commit if the bump is already upstream.
    • Deliberate config updates: take the incoming value (git checkout --theirs).
    • Generated artifacts: regenerate from source.

    Stage each fix, verify no conflict markers remain, then --continue (or --skip if the commit became empty). Pause and ask only for genuine semantic collisions in hand-written source — never guess those. Report how each conflict was resolved.

  8. After success, set tracking and push:

    git branch --set-upstream-to="origin/${subject}" "${subject}"
    git push --force-with-lease -u origin "${subject}:${subject}"
    git branch -vv
    
  9. Report strategy, branch, and tracking.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

2ndbrain

無料

Quick-save the last assistant response as a verbatim note in the 2ndBrain Obsidian vault (~/2ndBrain/quick-notes/<year>/). Use when the user asks to quick-save/save the last response to 2ndBrain, or invokes $2ndbrain or /skill:2ndbrain.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

Write commit messages under the agent-commits convention - a Conventional Commits fork with no chore catch-all, intent-only type tokens, facts in trailers, and legally-grounded AI provenance (Assisted-by, never Co-authored-by). Use when composing a commit in a repo whose commitlint.config.js extends agent-commits, when deciding between feat/fix/refactor/perf, or when recording AI participation.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

Coordinate multi-agent work through durable artifacts in git instead of chat. Use this whenever a task involves sending a message to another agent, agent mailboxes or handoffs, claiming work from a shared queue, notifying another agent or crew (OpenClaw, Grok Bot, Claude Code, Codex, Gas Town/Gas City workers) that work is ready, or whenever the user mentions the artifact bus, message bus, agent mail, beads mail, doorbells, or pings between agents — even if they don't say "bus" explicitly.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

aven

無料

Use aven to find tasks, update status, and leave durable handoff context.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

boris

無料

Codex workflow tips from Boris Cherny (creator of Codex) and the Codex team. Use when: setting up Codex, optimizing workflows, running parallel sessions, configuring AGENTS.md, using skills/commands, subagents, hooks, MCP integrations, or learning best practices. Covers: git worktrees, plan mode, verification, permissions, Slack MCP, BigQuery, prompting tips, plugins, custom agents, sandboxing, keybindings, status lines, output styles, customization, /simplify for code quality, /batch for parallel code migrations, /loop for scheduled tasks, code review agents, /btw for mid-task questions, /effort max reasoning, remote control sessions, voice mode, setup scripts, session naming, /color, PostCompact hook, auto mode, /schedule cloud jobs, iMessage plugin, auto-memory, and auto-dream, mobile app, session teleporting, Cowork Dispatch, Chrome extension, Desktop app, /branch forking, --bare SDK startup, --add-dir multi-repo, --agent custom agents, /voice input.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

boris

無料

Claude Code workflow tips from Boris Cherny (creator of Claude Code) and the Claude Code team. Use when: setting up Claude Code, optimizing workflows, running parallel sessions, configuring CLAUDE.md, using skills/commands, subagents, hooks, MCP integrations, or learning best practices. Covers: git worktrees, plan mode, verification, permissions, Slack MCP, BigQuery, prompting tips, plugins, custom agents, sandboxing, keybindings, status lines, output styles, customization, /simplify for code quality, /batch for parallel code migrations, /loop for scheduled tasks, code review agents, /btw for mid-task questions, /effort max reasoning, remote control sessions, voice mode, setup scripts, session naming, /color, PostCompact hook, auto mode, /schedule cloud jobs, iMessage plugin, auto-memory, and auto-dream, mobile app, session teleporting, Cowork Dispatch, Chrome extension, Desktop app, /branch forking, --bare SDK startup, --add-dir multi-repo, --agent custom agents, /voice input.

日本語の概要は準備中です。原文の説明を表示しています。

phatblat/dotfiles122026年10月11日 更新

phatblat のスキルをすべて見る

このスキルの問題を報告する