Skip to content

Glossary

Quick reference for terminology used throughout this documentation. If you’re new to code synchronization tools or coming from a different ecosystem, this page will help you understand the concepts.

Gerrit is an open-source, web-based code review tool developed by Google. It’s widely used in enterprise environments and open-source projects (including Android, Chromium, and Go).

Key differences from GitHub:

  • Uses “Change Lists” (CLs) instead of Pull Requests
  • Built-in support for multi-stage review workflows
  • Tighter integration with Git (changes are pushed to special refs)
  • Often used with Bazel build system

A Change List (CL) is Gerrit’s equivalent of a Pull Request. It represents a set of code changes submitted for review.

When Copybara creates a CL, it pushes to Gerrit’s special refs/for/<branch> reference, which triggers the review process.

Related: Gerrit Change Documentation

A Pull Request (PR) is GitHub’s mechanism for proposing code changes. GitLab calls these “Merge Requests” (MRs).

When Copybara uses git.github_pr_destination, it creates a branch and opens a PR for review.

Related: GitHub Pull Request Documentation

GitLab’s term for a Pull Request. Functionally equivalent to GitHub PRs.


The origin is the source repository that Copybara reads code from. This is where your “source of truth” code lives.

origin = git.github_origin(
url = "https://github.com/org/repo",
ref = "main",
)

Related: Origins & Destinations Overview

The destination is the target repository that Copybara writes code to. This is where transformed code ends up.

destination = git.destination(
url = "https://github.com/org/public-repo",
push = "main",
)

Related: Origins & Destinations Overview

A workflow is a named Copybara configuration that defines a complete sync operation: where to read from, where to write to, and what transformations to apply.

core.workflow(
name = "export",
origin = ...,
destination = ...,
transformations = [...],
)

You can define multiple workflows in a single config file (e.g., export and import).

Related: Workflow Modes

The Source of Truth (SOT) is the authoritative repository where canonical code lives. Changes always flow FROM the SOT to mirrors, never the reverse (unless explicitly importing contributions).

  • For export workflows: Internal repo is SOT → External repo is mirror
  • For import workflows: External repo is SOT → Internal repo receives contributions

Related: Core Concepts

A transformation is a modification applied to code during the sync process. Transformations run in sequence and can move files, replace text, filter content, and more.

transformations = [
core.move("internal/", "src/"),
core.replace("internal.corp.com", "example.com"),
]

Related: Transformations Overview


Squashing combines multiple commits into a single commit. In Copybara’s SQUASH mode, all origin changes since the last sync become one destination commit.

Commits A, B, C → Single commit "A + B + C"

Related: SQUASH vs ITERATIVE

Rebasing means reapplying commits on top of a different base commit. This creates a linear history without merge commits.

Copybara’s ITERATIVE mode works best with rebased (linear) histories.

Related: Git Rebase Documentation

A SHA (Secure Hash Algorithm) or commit hash is a unique 40-character identifier for a Git commit (e.g., abc123def456...). Often abbreviated to 7-8 characters.

Copybara tracks sync state using these hashes in the GitOrigin-RevId label.

A ref (reference) is a human-readable name pointing to a commit. Common refs include:

  • Branch names: main, develop
  • Tags: v1.0.0
  • Special refs: HEAD, refs/for/main (Gerrit)

A merge commit has two or more parent commits, created when merging branches. Copybara’s ITERATIVE mode may fail on merge commits; SQUASH handles them gracefully.


A monorepo (monolithic repository) is a single repository containing multiple projects, services, or components. Google, Meta, and Microsoft use monorepos internally.

Copybara is often used to extract portions of a monorepo for open-source release.

Example: Extracting //third_party/project/ from an internal monorepo to a public GitHub repo.

Related: Monorepo Extraction Use Case

Mirroring keeps two repositories synchronized. Unlike simple git push --mirror, Copybara can apply transformations during mirroring.

Related: Mirroring Repos Use Case


Starlark is a Python-like configuration language created by Google. It’s used by:

  • Bazel - Google’s build system
  • Buck2 - Meta’s build system
  • Copybara - For .bara.sky config files

Starlark is intentionally limited (no I/O, no infinite loops) to ensure configs are deterministic and fast to evaluate.

Related: Starlark Language Spec

A glob is a pattern for matching file paths. Copybara uses globs to specify which files to include or exclude.

PatternMatches
*Any characters except /
**Any characters including / (recursive)
?Single character
glob(["src/**/*.js"], exclude = ["**/*_test.js"])

Related: Glob Patterns, Glob Reference

Bazel is Google’s open-source build system. It uses Starlark for configuration (BUILD files). Many Copybara users come from Bazel-based environments.