git-workflows-2

SKILL开发
开发 未标注权限 许可证不明确
安装这个技能

高级git操作rebase/bisect/worktree/reflog/子树/子模块

一句话选型结论

按资料字段整理

git-workflows-2是开发类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类开发 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install zcwl/git-workflows-2
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

开发
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方zcwl仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 enterprise
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791682909
正文体量10.7 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
写代码与改 bug

按需求补代码、定位并修掉报错。

读仓库与生成改动

让模型读懂项目结构,再给出可落地的改动。

跑测试与排查故障

按现象排查问题,补测试用例并复跑。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在开发场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
git-workflows-2当前 未标注权限 未标注 未标注 未标注 有
技能审查员 浏览器控制 ClawHub 市场 877.9 万 OpenClaw 有
Vercel React 最佳实践 浏览器控制 GitHub 仓库 849.1 万 Codex、Claude、Cursor 有
GitHub 代码协作 联网访问 ClawHub 市场 763.3 万 OpenClaw 有
网页设计指南 联网访问 GitHub 仓库 668.6 万 Codex、Claude、Cursor 有
本体论 只读 ClawHub 市场 663.7 万 OpenClaw 有

SKILL.md 全文

10.7 KB
模型实际读到的说明书原文,来自技能仓库

Git Workflows

Advanced git operations for real-world development. Covers interactive rebase, bisect, worktree, reflog recovery, subtrees, submodules, sparse checkout, conflict resolution, and monorepo patterns.

When to Use

  • Cleaning up commit history before merging (interactive rebase)
  • Finding which commit introduced a bug (bisect)
  • Working on multiple branches simultaneously (worktree)
  • Recovering lost commits or undoing mistakes (reflog)
  • Managing shared code across repos (subtree/submodule)
  • Resolving complex merge conflicts
  • Cherry-picking commits across branches or forks
  • Working with large monorepos (sparse checkout)

Interactive Rebase

Squash, reorder, edit commits

git rebase -i HEAD~5

git rebase -i main

The editor opens with a pick list:

pick a1b2c3d Add user model
pick e4f5g6h Fix typo in user model
pick i7j8k9l Add user controller
pick m0n1o2p Add user routes
pick q3r4s5t Fix import in controller

Commands available:

pick   = use commit as-is
reword = use commit but edit the message
edit   = stop after this commit to amend it
squash = merge into previous commit (keep both messages)
fixup  = merge into previous commit (discard this message)
drop   = remove the commit entirely

Common patterns

pick a1b2c3d Add user model
fixup e4f5g6h Fix typo in user model
pick i7j8k9l Add user controller
fixup q3r4s5t Fix import in controller
pick m0n1o2p Add user routes

pick i7j8k9l Add user controller
pick m0n1o2p Add user routes
pick a1b2c3d Add user model

git reset HEAD~
git add src/model.ts
git commit -m "Add user model"
git add src/controller.ts
git commit -m "Add user controller"
git rebase --continue

Autosquash (commit messages that auto-arrange)

git commit --fixup=a1b2c3d -m "Fix typo"
git commit --squash=a1b2c3d -m "Additional changes"

git rebase -i --autosquash main

Abort or continue

git rebase --abort      # Cancel and restore original state
git rebase --continue   # Continue after resolving conflicts or editing
git rebase --skip       # Skip the current commit and continue

Bisect (Find the Bug)

Binary search through commits

git bisect start

git bisect bad

git bisect good v1.2.0

git bisect good   # if this commit doesn't have the bug
git bisect bad    # if this commit has the bug

git bisect reset

Automated bisect (with a test script)

git bisect start HEAD v1.2.0
git bisect run ./test-for-bug.sh

cat > /tmp/test-for-bug.sh << 'EOF'
#!/bin/bash
npm test -- --grep "login should redirect" 2>/dev/null
EOF
chmod +x /tmp/test-for-bug.sh
git bisect run /tmp/test-for-bug.sh

Bisect with build failures

git bisect skip

git bisect skip v1.3.0..v1.3.5

Worktree (Parallel Branches)

Work on multiple branches simultaneously

git worktree add ../myproject-hotfix hotfix/urgent-fix

git worktree add ../myproject-feature -b feature/new-thing

git worktree list

git worktree remove ../myproject-hotfix

git worktree prune

Use cases

git worktree add ../review-pr-123 origin/pr-123

git worktree add ../main-tests main
cd ../main-tests && npm test

git worktree add ../compare-old release/v1.0
git worktree add ../compare-new release/v2.0

Reflog (Recovery)

See everything git remembers

git reflog

git reflog show feature/my-branch

git reflog --date=relative

Recover from mistakes

git reflog
git reset --hard ghi789

git reflog
git branch recovered-branch abc123

git reflog
git reset --hard HEAD@{2}   # Go back 2 reflog entries

git fsck --unreachable | grep commit
git stash list  # if it's still there
git log --walk-reflogs --all -- stash  # find dropped stash commits

Cherry-Pick

Copy specific commits to another branch

git cherry-pick abc123

git cherry-pick abc123 def456 ghi789

git cherry-pick abc123..ghi789

git cherry-pick --no-commit abc123

git remote add upstream https://github.com/other/repo.git
git fetch upstream
git cherry-pick upstream/main~3   # 3rd commit from upstream's main

Handle conflicts during cherry-pick

git add resolved-file.ts
git cherry-pick --continue

git cherry-pick --abort

Subtree and Submodule

Subtree (simpler — copies code into your repo)

git subtree add --prefix=lib/shared https://github.com/org/shared-lib.git main --squash

git subtree pull --prefix=lib/shared https://github.com/org/shared-lib.git main --squash

git subtree push --prefix=lib/shared https://github.com/org/shared-lib.git main

git subtree split --prefix=lib/shared -b shared-lib-standalone

Submodule (pointer to another repo at a specific commit)

git submodule add https://github.com/org/shared-lib.git lib/shared

git clone --recurse-submodules https://github.com/org/main-repo.git

git submodule update --init --recursive

git submodule update --remote

git rm lib/shared
rm -rf .git/modules/lib/shared

When to use which

Subtree: Simpler, no special commands for cloners, code lives in your repo.
         Use when: shared library, vendor code, infrequent upstream changes.

Submodule: Pointer to exact commit, smaller repo, clear separation.
           Use when: large dependency, independent release cycle, many contributors.

Sparse Checkout (Monorepo)

Check out only the directories you need

git sparse-checkout init --cone

git sparse-checkout set packages/my-app packages/shared-lib

git sparse-checkout add packages/another-lib

git sparse-checkout list

git sparse-checkout disable

Clone with sparse checkout (large monorepos)

git clone --filter=blob:none --sparse https://github.com/org/monorepo.git
cd monorepo
git sparse-checkout set packages/my-service

git clone --no-checkout https://github.com/org/monorepo.git
cd monorepo
git sparse-checkout set packages/my-service
git checkout main

Conflict Resolution

Understand the conflict markers

<<<<<<< HEAD (or "ours")
Your changes on the current branch
=======
Their changes from the incoming branch
>>>>>>> feature-branch (or "theirs")

Resolution strategies

git checkout --ours path/to/file.ts
git add path/to/file.ts

git checkout --theirs path/to/file.ts

git checkout --ours .
git add .

git mergetool

git diff --cc path/to/file.ts

git show :1:path/to/file.ts   # base (common ancestor)
git show :2:path/to/file.ts   # ours
git show :3:path/to/file.ts   # theirs

Rebase conflict workflow

git add fixed-file.ts
git rebase --continue

git rebase --skip

Rerere (reuse recorded resolutions)

git config --global rerere.enabled true

ls .git/rr-cache/

git rerere forget path/to/file.ts

Stash Patterns

git stash push -m "WIP: refactoring auth flow"

git stash push -m "partial stash" -- src/auth.ts src/login.ts

git stash push -u -m "with untracked"

git stash list

git stash apply

git stash pop

git stash apply stash@{2}

git stash show -p stash@{0}

git stash branch new-feature stash@{0}

git stash drop stash@{1}

git stash clear

Blame and Log Archaeology

git blame src/auth.ts

git blame -L 50,70 src/auth.ts

git blame -w src/auth.ts

git log -S "function oldName" --oneline

git log -G "TODO.*hack" --oneline

git log --follow --oneline -- src/new-name.ts

git blame -M src/auth.ts

git log --stat --oneline -20

git log --oneline -- src/auth.ts

git show abc123

Tags and Releases

git tag -a v1.2.0 -m "Release 1.2.0: Added auth module"

git tag v1.2.0

git tag -a v1.1.0 abc123 -m "Retroactive tag for release 1.1.0"

git tag -l
git tag -l "v1.*"

git push origin v1.2.0      # Single tag
git push origin --tags       # All tags

git tag -d v1.2.0            # Local
git push origin --delete v1.2.0  # Remote

Tips

  • git rebase -i is the single most useful advanced git command. Learn it first.
  • Never rebase commits that have been pushed to a shared branch. Rebase your local/feature work only.
  • git reflog is your safety net. If you lose commits, they're almost always recoverable within 90 days.
  • git bisect run with an automated test is faster than manual binary search and eliminates human error.
  • Worktrees are cheaper than multiple clones — they share .git storage.
  • Prefer git subtree over git submodule unless you have a specific reason. Subtrees are simpler for collaborators.
  • Enable rerere globally. It remembers conflict resolutions so you never solve the same conflict twice.
  • git stash push -m "description" is much better than bare git stash. You'll thank yourself when you have 5 stashes.
  • git log -S "string" (pickaxe) is the fastest way to find when a function or variable was added or removed.

依赖说明

运行环境

  • Agent平台: 支持SKILL.md的任意AI Agent(Claude Code / Cursor / Codex / Gemini CLI等)
  • 操作系统: Windows / macOS / Linux

依赖说明

依赖项 类型 是否必需 获取方式
LLM API API 必需 由Agent内置LLM提供

API Key 配置

  • 本Skill基于Markdown指令,无需额外API Key(除内容中明确标注的外部API)

可用性分类

  • 分类: MD+EXEC(纯Markdown指令,部分功能需要exec命令行执行能力)
  • 说明: 基于Markdown的AI Skill,通过自然语言指令驱动Agent执行任务

核心能力

  • Advanced git operations beyond add/commit/push
  • Use when rebasing, bisecting
    bugs, using worktree
  • 触发关键词: workflows, operations, git, push, advanced, commit, beyond

使用流程

  1. 确认运行环境满足依赖说明中的要求
  2. 根据适用场景选择合适的使用方式
  3. 执行操作并检查输出结果
  4. 如遇错误,参考错误处理章节

示例

示例1:基础用法


错误处理

错误场景 原因 处理方式
配置错误 参数缺失或格式错误 检查依赖说明中的配置要求
运行时错误 运行环境不满足 确认运行环境符合依赖说明
网络错误 连接超时或不可达 检查网络连接后重试,参考国内替代方案

常见问题

Q1: 如何开始使用Git Workflows?

A: 请先阅读使用流程章节,确认环境满足依赖说明中的要求。

Q2: 遇到错误怎么办?

A: 请参考错误处理章节,按照表格中的处理方式操作。

Q3: Git Workflows有什么限制?

A: 请参考已知限制章节了解具体限制。

已知限制

  • 需要LLM支持,无LLM环境无法使用
  • 复杂场景可能需要人工辅助判断
  • 性能取决于底层模型能力

常见问题

5 问
答案由本站依据条目字段整理
git-workflows-2怎么安装?

在支持 Skills 的客户端里执行:skillhub install zcwl/git-workflows-2。安装方式为未标注。装完刷新技能列表或重开客户端。

git-workflows-2支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

git-workflows-2权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

git-workflows-2收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

git-workflows-2用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。