This example demonstrates how to use beads for team collaboration with shared repositories.
When working as a team on a shared repository, you want to:
- Track issues collaboratively
- Keep everyone in sync via git
- Handle protected main branches
- Maintain clean git history
Use bd init --team to set up team collaboration with automatic sync and optional protected branch support.
# In your shared repository
cd my-project
# Run the team setup wizard
bd init --teamThe wizard will:
- ✅ Detect your git configuration
- ✅ Ask if main branch is protected
- ✅ Configure sync branch (if needed)
- ✅ Set up automatic sync
- ✅ Enable team mode
If your main branch is protected (GitHub/GitLab), the wizard will:
- Create a separate
beads-metadatabranch for issue updates - Configure beads to commit to this branch automatically
- Set up periodic PR workflow for merging to main
Other team members just need to:
# Clone the repository
git clone https://github.com/org/project.git
cd project
# Initialize beads (auto-imports existing issues)
bd init
# Start working!
bd readyIf main isn't protected:
# Create issue
bd create "Implement feature X" -p 1
# Daemon auto-commits to main
# (or run 'bd sync' manually)
# Pull to see team's issues
git pull
bd listIf main is protected:
# Create issue
bd create "Implement feature X" -p 1
# Daemon commits to beads-metadata branch
# (or run 'bd sync' manually)
# Push beads-metadata
git push origin beads-metadata
# Periodically: merge beads-metadata to main via PRThe wizard configures:
team:
enabled: true
sync_branch: beads-metadata # or main if not protected
daemon:
auto_commit: true
auto_push: true# Enable team mode
bd config set team.enabled true
# Set sync branch
bd config set team.sync_branch beads-metadata
# Enable auto-sync
bd config set daemon.auto_commit true
bd config set daemon.auto_push true# Alice creates an issue
bd create "Fix authentication bug" -p 1
# Daemon commits and pushes to main
# (auto-sync enabled)
# Bob pulls changes
git pull
bd list # Sees Alice's issue
# Bob claims it
bd update bd-abc --status in_progress
# Daemon commits Bob's update
# Alice pulls and sees Bob is working on it# Alice creates an issue
bd create "Add new API endpoint" -p 1
# Daemon commits to beads-metadata
git push origin beads-metadata
# Bob pulls beads-metadata
git pull origin beads-metadata
bd list # Sees Alice's issue
# Later: merge beads-metadata to main via PR
git checkout main
git pull origin main
git merge beads-metadata
# Create PR, get approval, merge# See what everyone's working on
bd list --status in_progress
# See what's ready for work
bd ready
# See recently closed issues
bd list --status closed --limit 10# Create sprint issues
bd create "Implement user auth" -p 1
bd create "Add profile page" -p 1
bd create "Fix responsive layout" -p 2
# Assign to team members
bd update bd-abc --assignee alice
bd update bd-def --assignee bob
# Track dependencies
bd dep add bd-def bd-abc --type blocks# Create issue for PR work
bd create "Refactor auth module" -p 1
# Work on it
bd update bd-abc --status in_progress
# Open PR with issue reference
git push origin feature-branch
# PR title: "feat: refactor auth module (bd-abc)"
# Close when PR merges
bd close bd-abc --reason "PR #123 merged"Daemon commits and pushes automatically:
bd daemon --start --auto-commit --auto-pushBenefits:
- ✅ Always in sync
- ✅ No manual intervention
- ✅ Real-time collaboration
Sync when you want:
bd sync # Export, commit, pull, import, pushBenefits:
- ✅ Full control
- ✅ Batch updates
- ✅ Review before push
Hash-based IDs prevent most conflicts. If conflicts occur:
# During git pull/merge
git pull origin beads-metadata
# CONFLICT in .beads/issues.jsonl
# Option 1: Accept remote
git checkout --theirs .beads/issues.jsonl
bd import -i .beads/issues.jsonl
# Option 2: Accept local
git checkout --ours .beads/issues.jsonl
bd import -i .beads/issues.jsonl
# Option 3: Use beads-merge tool (recommended)
# See docs/GIT_INTEGRATION.md for merge conflict resolution
git add .beads/issues.jsonl
git commit-
Create beads-metadata branch
git checkout -b beads-metadata git push origin beads-metadata
-
Configure protection rules
- Allow direct pushes to beads-metadata
- Require PR for main
-
Periodic PR workflow
# Once per day/sprint git checkout main git pull origin main git checkout beads-metadata git pull origin beads-metadata git checkout main git merge beads-metadata # Create PR, get approval, merge
-
Keep beads-metadata clean
# After PR merges git checkout beads-metadata git rebase main git push origin beads-metadata --force-with-lease
A: Issues are stored in .beads/issues.jsonl which is version-controlled. Pull from git to sync.
git pull
bd list # See everyone's issuesA: Hash-based IDs prevent collisions. Even if created simultaneously, they get different IDs.
A: Turn it off:
bd config set daemon.auto_commit false
bd config set daemon.auto_push false
# Sync manually
bd syncA: Not recommended. Use a single shared branch for consistency. If needed:
bd config set sync.branch my-custom-branchA: Add to your CI pipeline:
# In .github/workflows/main.yml
- name: Sync beads issues
run: |
bd sync
git push origin beads-metadataCheck daemon status:
bd daemon --status
bd daemons listVerify config:
bd config get daemon.auto_commit
bd config get daemon.auto_pushRestart daemon:
bd daemon --stop
bd daemon --start --auto-commit --auto-pushUse beads-merge or resolve manually (see GIT_INTEGRATION.md):
git checkout --theirs .beads/issues.jsonl
bd import -i .beads/issues.jsonl
git add .beads/issues.jsonl
git commitManually sync:
bd sync
git pushCheck for conflicts:
git status
bd validate --checks=conflicts