Workflows
Learn about SQUASH, ITERATIVE, and CHANGE_REQUEST modes for different sync scenarios.
Copybara is Google’s tool for transforming and moving code between repositories. It enables workflows like:
Workflows
Learn about SQUASH, ITERATIVE, and CHANGE_REQUEST modes for different sync scenarios.
Transformations
Move files, replace text, filter content, and verify no secrets are leaked.
GitHub Integration
Create pull requests automatically instead of direct pushes.
CI/CD
Run Copybara in GitHub Actions with automated triggers.
core.workflow( name = "export-to-github", origin = git.origin( url = "https://internal.git/repo", ref = "main", ), destination = git.github_pr_destination( url = "https://github.com/org/public-repo", destination_ref = "main", ), origin_files = glob(["src/**"], exclude = ["**/internal/**"]), transformations = [ core.move("src/", ""), core.replace("internal.corp", "example.com"), ], mode = "SQUASH",)| Feature | Benefit |
|---|---|
| Declarative config | Define what you want, not how to do it |
| Bidirectional | Export and import between any repositories |
| Transformations | Modify paths, content, and metadata during sync |
| State tracking | Automatically tracks what’s been synced |
| PR-based | Create PRs instead of direct pushes |
Copybara is developed by Google and licensed under Apache License 2.0.