Skip to main content

main-worktree

在不切换当前 main 分支的情况下,通过 git worktree 编辑 stable 分支内容(hotfix), 然后合并回 main 保持 stable⊆main 不变式。用户说「hotfix」「改 stable」「stable worktree」 「在 stable 上修」「同步回 main」时使用。关键词:worktree, stable, hotfix, 热修复, 稳定分支, 合并回 main, 不切分支, git worktree

소스 정보

저장소
zerx-lab/FluxDown
최근 소스 활동
2026년 10월 13일 08:28
감지된 SKILL.md 언어
중국어
스타
4,535
포크
264

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
main-worktree
description
在不切换当前 main 分支的情况下,通过 git worktree 编辑 stable 分支内容(hotfix), 然后合并回 main 保持 stable⊆main 不变式。用户说「hotfix」「改 stable」「stable worktree」 「在 stable 上修」「同步回 main」时使用。关键词:worktree, stable, hotfix, 热修复, 稳定分支, 合并回 main, 不切分支, git worktree
# stable 分支 worktree 热修流程 主目录始终停在 `main`;`stable` 挂在仓库内 worktree `.worktrees/stable`(已在 `.gitignore`)。 适用场景:需要直接修改 `stable`(稳定分支)内容的 hotfix,改完必须同回合合并回 `main`。 ## 流程 ```bash # 0. worktree 不存在则创建(仅首次;已存在直接跳过) git worktree list git worktree add .worktrees/stable stable # 1. 更新 stable worktree git -C .worktrees/stable pull --ff-only # 有远端更新时 # 2. 在 .worktrees/stable 内编辑、验证、提交(Conventional Commits 中文; # commit/push 仍需用户明确要求 —— 红线) # 3. 回主目录合并回 main,恢复不变式 git merge stable # 4. 校验不变式:输出必须为空,否则违规,先修复 git log stable --not main --oneline ``` ## 红线(不可违反) - `stable` 上只做 hotfix / cherry-pick,禁止直接开发新功能(功能一律在 `main`)。 - hotfix 进 `stable` 后**同一回合**必须合并回 `main`,不许留到以后。 - 未经用户明确要求禁止 commit / push / tag;推送 v* tag 触发不可逆发布流水线。 - 稳定 tag `vX.Y.Z` 只在 stable worktree(`.worktrees/stable`)里打。 ## 注意 - 同一分支不能同时被两个 worktree checkout;主目录保持 `main`。 - worktree 有独立的 `target/`、`build/`,首次构建全量编译属正常。 - 收尾可选:`git worktree remove .worktrees/stable`(长期保留也没问题)。
GitHub에서 보기