From f8bae643c8d596f3ab8990b0f004f53e631ea50b Mon Sep 17 00:00:00 2001 From: stranske Date: Sat, 3 Jan 2026 12:29:44 +0000 Subject: [PATCH] fix: sync .gitattributes to prevent pr_body.md merge conflicts Add .gitattributes to consumer-repo template with merge=ours strategy for: - pr_body.md: Contains PR-specific content that differs between branches - ci/autofix/history.json: Append-only file that causes similar conflicts Root cause: pr_body.md is modified by every PR with issue-specific tasks/criteria. When PR A merges, main gets PR A's content. All other open PRs then conflict because they have different issue-specific content. The merge=ours strategy tells Git to keep the current branch's version, eliminating these recurring conflicts across all consumer repos. --- .github/sync-manifest.yml | 6 ++++++ templates/consumer-repo/.gitattributes | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 templates/consumer-repo/.gitattributes diff --git a/.github/sync-manifest.yml b/.github/sync-manifest.yml index afa9b0109..25cc5d541 100644 --- a/.github/sync-manifest.yml +++ b/.github/sync-manifest.yml @@ -196,6 +196,12 @@ docs: target: CLAUDE.md description: "Context file for Claude/AI assistants" +# Git configuration files for merge strategies +git_config: + - source: .gitattributes + description: "Git attributes - merge strategies to prevent pr_body.md conflicts" + + # Files that exist in templates but are NOT synced (consumer creates their own) excluded: diff --git a/templates/consumer-repo/.gitattributes b/templates/consumer-repo/.gitattributes new file mode 100644 index 000000000..ce120b75d --- /dev/null +++ b/templates/consumer-repo/.gitattributes @@ -0,0 +1,10 @@ +# Git attributes for consumer repos synced from Workflows +# +# Merge strategies to prevent recurring conflicts on PR-specific files: +# pr_body.md contains issue-specific content that differs between branches. +# Using merge=ours keeps each branch's version during merges. + +pr_body.md merge=ours + +# CI autofix history is append-only and branch-specific +ci/autofix/history.json merge=ours linguist-generated