Copybara is Google’s tool for syncing code between repositories while applying scripted transformations, preserving enough history to keep authorship and blame useful, and supporting workflows where one codebase has to exist in two different shapes. The obvious case is Google’s internal monorepo exporting projects to GitHub, but people pointed out the reverse direction is just as important: importing upstream open source into a monorepo, keeping private forks close to upstream, or translating code between different build and import conventions. That is the center of gravity here. Copybara is not a fancy replacement for submodules, subtrees, or plain repo mirroring. It exists because mirrors are often not exact mirrors.
The practical consensus was sharp. Copybara shines when the two repos need deterministic mechanical rewrites such as path remaps, file filtering, header stripping,
BUILD file translation, or import rewriting. For pure sync it is overkill. For bidirectional sync it gets messy fast unless one side is clearly the source of truth and divergence stays small. Several people with direct experience said the common pattern is one-way export or import, then accepting outside changes by reapplying the inverse transform back into the source repo. That can be automated, but only when the transforms are stable and mostly invertible.
A few details helped clarify what the tool actually does. History is not preserved as identical Git commits. Copybara rewrites commits and records the original revision in commit metadata, which is good enough for blame and later correlation but not the same as transplanting original SHAs. Performance also came up repeatedly. Users said it can be slow, especially over remote repos or large histories, and suggested local repos for bulk exports. That performance gap is part of why people compared it with other tools instead of treating it as the default answer.
The alternatives discussion was useful but also narrowed the scope.
Git subtree was framed as the old baseline, good for simpler cases but weak at scale and far less capable on transforms.
Josh got attention as a more modern option, especially for exposing monorepo directories as separate repos.
Jujutsu and custom scripts with
git-filter-repo were offered as lighter solutions when you only need file extraction or simple syncing. The throughline was that Copybara earns its complexity only when your repo boundary is artificial and the code on each side cannot stay byte-for-byte identical.