Resolving Merge Conflicts

作者 mattpocockc55ee46073ed無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Use when you need to resolve an in-progress git merge/rebase conflict.

AI 產生的概覽

引導代理逐步解決進行中的 git 合併或重定基底衝突。

功能
此技能提供一套五步流程,用來解決進行中的 git 合併或重定基底衝突。內容涵蓋檢查目前狀態與衝突檔案、透過提交訊息、提取要求與票據追溯每處衝突的原始意圖、在可能時保留雙方意圖逐段解決衝突、執行專案的自動化檢查,以及透過暫存與提交完成合併或重定基底。它僅包含指示,產出的是已完成並提交的合併或重定基底,而非檔案成品。
適用情境
適用於 git 合併或重定基底已在進行中,並留下待解決衝突檔案的情況。也適合代理需要判斷如何協調相互衝突的變更,並以專案本身的檢查驗證結果時使用。
執行需求
需要一個有進行中合併或重定基底的 git 儲存庫,並能存取 git 歷史、提交訊息、提取要求與票據。執行專案的自動化檢查需要專案所用的工具,例如型別檢查器、測試套件與格式化工具。此技能不附帶指令碼,僅為指示。
  1. See the current state of the merge/rebase. Check git history, and the conflicting files.

  2. Find the primary sources for each conflict. Understand deeply why each change was made, and what the original intent was. Read the commit messages, check the PRs, check original issues/tickets.

  3. Resolve each hunk. Preserve both intents where possible. Where incompatible, pick the one matching the merge's stated goal and note the trade-off. Do not invent new behaviour. Always resolve; never --abort.

  4. Discover the project's automated checks and run them, typically typecheck, then tests, then format. Fix anything the merge broke.

  5. Finish the merge/rebase. Stage everything and commit. If rebasing, continue the rebase process until all commits are rebased.

來源與署名

來源:mattpocock/skills位於skills/engineering/resolving-merge-conflicts提交c55ee46

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架