Community & Resources
Collection of real-world Copybara usage, blog posts, and community resources.
Companies Using Copybara
Section titled “Companies Using Copybara”Google (Internal Projects)
Section titled “Google (Internal Projects)”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
OpenXLA Project
Section titled “OpenXLA Project”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
Section titled “MongoDB”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 Language
Section titled “CUE Language”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
Section titled “Hasura”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/Fuchsia
Section titled “Pigweed/Fuchsia”Pigweed uses Copybara to sync Fuchsia libraries:
- Files synced to
third_party/fuchsia/repodirectory - Copybara applies patches (e.g., replacing
__builtin_abortwithPW_ASSERT) - Avoids requiring downstream projects to clone the large Fuchsia repo
GitHub Actions Integration
Section titled “GitHub Actions Integration”Olivr/copybara-action
Section titled “Olivr/copybara-action”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 casesFeatures:
- Zero-config defaults
- Bidirectional sync support
- Custom Docker image support
- Fully customizable for advanced workflows
Blog Posts & Tutorials
Section titled “Blog Posts & Tutorials”Official Resources
Section titled “Official Resources”- Copybara GitHub Repository - Source code and documentation
- Copybara Examples - Official examples
- Copybara Reference - Complete API reference
Community Tutorials
Section titled “Community Tutorials”- Moving code between GIT repositories with Copybara (Kubesimplify) - Step-by-step tutorial covering monorepo to public repo sync
- Copybara: A Tool for Transforming and Moving Code (Medium) - Introduction and use cases
- Google’s Copybara reshapes large-scale code movement - Enterprise adoption overview
Example Configurations
Section titled “Example Configurations”Real copy.bara.sky files from production:
| Project | Link | Use Case |
|---|---|---|
| MongoDB | copy.bara.sky | Internal → public with scrubbing |
| CUE | copy.bara.sky | Gerrit ↔ GitHub bidirectional |
| WireQuery | copy.bara.sky | Open source sync |
Community Support
Section titled “Community Support”Mailing List
Section titled “Mailing List”The Copybara OSS Google Group is the official discussion forum:
- Ask questions about configuration
- Report issues and get help
- Discuss feature requests
- Share experiences
GitHub Issues
Section titled “GitHub Issues”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)
Lessons from Production
Section titled “Lessons from Production”Common Patterns
Section titled “Common Patterns”- Scrub sensitive content - Use
metadata.scrubber()to remove internal references - Preserve attribution - Use
metadata.save_author()andmetadata.restore_author() - Handle internal links - Use
core.replace()to update URLs - Exclude directories - Use glob excludes for private code
Known Limitations
Section titled “Known Limitations”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)
Tips from Users
Section titled “Tips from Users”- Start simple - Use basic push workflow before adding complexity
- Test with dry-run - Always use
--dry-runbefore production - Version pin - Pin to specific Copybara versions in CI
- Document internally - Keep notes on your specific workflow
Related Tools
Section titled “Related Tools”- git-filter-repo - For one-time history rewriting
- git-subtree - For simpler subtree management
- repo tool - Android’s multi-repo management
Contributing
Section titled “Contributing”If you’ve written about Copybara or have production experience to share:
- Open a PR to add your resource
- Share on the mailing list
- Create a GitHub issue with your use case