Skip to content

Community & Resources

Collection of real-world Copybara usage, blog posts, and community resources.

Google uses Copybara extensively to sync between their internal monorepo (Piper) and public GitHub repositories:

  • TensorFlow - ML framework synced from internal repo
  • gRPC - RPC framework with internal/external sync
  • Abseil - C++ library synced via Copybara
  • Protobuf - Protocol buffers with internal development
  • Android (AOSP) - Components synced between internal and public repos

The OpenXLA project documents their Copybara usage extensively:

  • Source of truth is Google’s internal repo
  • PRs are imported internally, tested, then submitted
  • Copybara applies formatting transformations
  • PRs are closed (not merged) with equivalent commits applied
  • TSL dependency is copied into third_party/ to prevent broken commits

MongoDB uses Copybara to sync from internal (10gen/mongo) to public (mongodb/mongo):

  • Excludes sensitive directories (src/mongo/db/modules/**, src/third_party/private/**)
  • Scrubs commit messages to remove internal references
  • Preserves acceptable trailers (Co-authored-by, Signed-off-by)
  • Replaces internal GitHub links with public equivalents

CUE uses Copybara for Gerrit-GitHub bidirectional sync:

  • Mirrors changes from Gerrit (cue-review.googlesource.com) to GitHub
  • Imports GitHub PRs into Gerrit for review
  • Transforms PR titles/bodies into Gerrit commit format

Hasura documented their experience using Copybara for monorepo management:

What worked:

  • Automated bidirectional shadowing of PRs
  • Transformed OSS contributions to fit monorepo structure

Challenges encountered:

  • Missing multi-author attribution support
  • Tool felt “too coupled with Google’s workflows”
  • Had to fork Copybara to add missing functionality

Their suggestion: Consider a simpler alternative for basic commit-by-commit transformation needs.

Pigweed uses Copybara to sync Fuchsia libraries:

  • Files synced to third_party/fuchsia/repo directory
  • Copybara applies patches (e.g., replacing __builtin_abort with PW_ASSERT)
  • Avoids requiring downstream projects to clone the large Fuchsia repo

The copybara-action provides zero-config GitHub Actions integration:

- uses: olivr/copybara-action@v1
with:
ssh_key: ${{ secrets.SSH_KEY }}
# Defaults work for most monorepo → public repo cases

Features:

  • Zero-config defaults
  • Bidirectional sync support
  • Custom Docker image support
  • Fully customizable for advanced workflows

Real copy.bara.sky files from production:

ProjectLinkUse Case
MongoDBcopy.bara.skyInternal → public with scrubbing
CUEcopy.bara.skyGerrit ↔ GitHub bidirectional
WireQuerycopy.bara.skyOpen source sync

The Copybara OSS Google Group is the official discussion forum:

  • Ask questions about configuration
  • Report issues and get help
  • Discuss feature requests
  • Share experiences

For bugs and feature requests:

Common discussion topics:

  • Environment variables in configurations (#125)
  • GitHub PR to Gerrit workflows (#249)
  • Bidirectional sync patterns (#140)
  • Multiple config files (#268)
  1. Scrub sensitive content - Use metadata.scrubber() to remove internal references
  2. Preserve attribution - Use metadata.save_author() and metadata.restore_author()
  3. Handle internal links - Use core.replace() to update URLs
  4. Exclude directories - Use glob excludes for private code

Based on community experiences:

  • Google-centric design - Some workflows assume Google’s internal tooling
  • Learning curve - Starlark syntax requires familiarity
  • Multi-author PRs - May need custom handling (Hasura’s experience)
  • Transformation quirks - Diffs may differ due to formatting (OpenXLA’s experience)
  1. Start simple - Use basic push workflow before adding complexity
  2. Test with dry-run - Always use --dry-run before production
  3. Version pin - Pin to specific Copybara versions in CI
  4. Document internally - Keep notes on your specific workflow

If you’ve written about Copybara or have production experience to share:

  1. Open a PR to add your resource
  2. Share on the mailing list
  3. Create a GitHub issue with your use case