Merge conflict resolution: sync-branch in config.yaml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-30 11:16:50 -08:00
3 changed files with 89 additions and 81 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1038,6 +1038,13 @@ func createConfigYaml(beadsDir string, noDbMode bool) error {
# Debounce interval for auto-flush (can also use BEADS_FLUSH_DEBOUNCE)
# flush-debounce: "5s"
# Git branch for beads commits (bd sync will commit to this branch)
# IMPORTANT: Set this for team projects so all clones use the same sync branch.
# This setting persists across clones (unlike database config which is gitignored).
# Can also use BEADS_SYNC_BRANCH env var for local override.
# If not set, bd sync will require you to run 'bd config set sync.branch <branch>'.
# sync-branch: "beads-sync"
# Multi-repo configuration (experimental - bd-307)
# Allows hydrating from multiple repositories and routing writes to the correct JSONL
# repos:
@@ -1054,7 +1061,6 @@ func createConfigYaml(beadsDir string, noDbMode bool) error {
# - linear.api-key
# - github.org
# - github.repo
# - sync.branch - Git branch for beads commits (use BEADS_SYNC_BRANCH env var or bd config set)
`, noDbLine)
if err := os.WriteFile(configYamlPath, []byte(configYamlTemplate), 0600); err != nil {

View File

@@ -74,6 +74,7 @@ func Get(ctx context.Context, store storage.Storage) (string, error) {
}
// Check config.yaml (version controlled, shared across clones)
// This is the recommended way to configure sync branch for teams
if yamlBranch := config.GetString(ConfigYAMLKey); yamlBranch != "" {
if err := ValidateBranchName(yamlBranch); err != nil {
return "", fmt.Errorf("invalid %s in config.yaml: %w", ConfigYAMLKey, err)