HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
google
copybara
Java2017–2026
google / copybara

copybara

Copybara: A tool for transforming and moving code between repositories.

20Distinct people
21Mentions
0Explicit recommenders
3.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Copybara: A tool for transforming and moving code between repositories.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year21 dated mentions

Observed mentions: 2017-03-15 22:55:50 UTC to 2026-08-20 04:16:12 UTC.

012342017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC211
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC202
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC413
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC404
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC211
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC413

What Hacker News says

21 sources
I already shared git-fetch-file in another comment here, but the .git-remote-files manifests seem a lot nicer than whatever this thing does: [file "lib/util.py" from "https://github.com/example/tools.git"] commit = a1b2c3d4e5f6789abcdef0123456789abcdef01 branch = master comment = Common utility function [file "config.json" from "https://github.com/example/tools.git"] commit = b2c3d4e5f6789abcdef0123456789abcdef012 branch = master target = vendor comment = Configuration from tools repo [file "helper.js" from "https://github.com/another/project.git"] commit = c3d4e5f6789abcdef0123456789abcdef0123 branch = main comment = Helper from another project vs core.workflow( name = "default", origin = git.github_origin( url = "https://github.com/google/copybara.git",
Read the rest
ref = "master", ), destination = git.destination( url = "file:///tmp/foo", ), # Copy everything but don't remove a README_INTERNAL.txt file if it exists. destination_files = glob(["third_party/copybara/**"], exclude = ["README_INTERNAL.txt"]), authoring = authoring.pass_thru("Default email <default@default.com>"), transformations = [ core.replace( before = "//third_party/bazel/bashunit", after = "//another/path:bashunit", paths = glob(["**/BUILD"])), core.move("", "third_party/copybara") ], ) There seems to be an absolute ton of reference at https://github.com/google/copybara/blob/master/docs/referenc..., whereas I feel like all the people using git-fetch-file just want files from other repos, and sometimes to make some changes on those.
In Google copybara: moving code between repositories
Ha! This post comes right at the time where I finally got around to open sourcing the patches I made to provide Perforce support which I use at my gamedev studio[0]. I find it kind of funny that perforce support was not included, only git support seems to exist in any meaningful way: despite the primary use of copybara being for releasing internal google code (which lives in Piper, a fork of Perforce). I actually got a bit worried when looking at the git history before making the PR, because there's a lot of Gerrit Change-ID markers (meaning there's some gerrit code review system somewhere which I'm not privvy too) and I might have submitted a PR which never gets upstreamed.. I feel the same pang of pain from the lack of a perforce version of Gerrit/Rietveld.. but, you can't ask for everything! [0]: https://github.com/google/copybara/pull
Read the rest
In Google copybara: moving code between repositories
sure! it used a collection of tools, the main ones were * copybara [https://github.com/google/copybara] to mirror between github and our internal repo and transform the source tree layout to our internal conventions * mercurial patch queues [https://hgbook.red-bean.com/read/managing-change-with-mercur...] to apply internal changes there are internal tools to automate the copybara configuration for python packages specifically, and to map between mercurial and google's version control system, but that's the main idea, and a specific review process for adding new packages. the process is actually documented here though not all the referenced tools are available (or even applicable) externally: https://opensource.google/documentation/reference/thirdparty...
In Google lays off its Python team
Git is a tool for collaboration, but is sometimes a poor fit for the reality of centralised, corporate software development. I'd like to see a product that fills these gaps, and I sense that this is part of what Diversion is about. For example, large file support in git depends on clunky hacks (that I respect) like LFS, but Diversion aims to make it actually work seamlessly. Companies awkwardly split their projects across many repos just to allow for access control, but Diversion aims to makes it easy by letting you just set access for directory. Those are great, "no-brainer" advances. There are a lot of other places where clunky hacks appear in popular git usage. A lot of those are also areas where big tech has introduced their own internal solutions. Maybe Diversion can cover some of these? Some examples: - git has a very useful hooks
Read the rest
mechanism, but each user has to manage their installed hooks in their own clone. This should be made more team-compatible. Make hooks a part of the history that can be patched by anyone, and then others can update their hooks simply by pulling. A less-clunky, built-in version of https://pre-commit.com/ , basically. - Keeping with use cases for hooks, it should be possible to apply code formatting transparently. Nobody should have to think about code formatting, ever. It's a common practice to ensure code conforms to the company's standard format. However, why can't a developer also work in their preferred format? It should be possible for the system to handle this. I work in my preferred format, but all of the committed code is actually in the company's standard format. A bidirectional transformation. - Break down the barrier between repo and other channels of company communication. Often companies have a wiki, a document drive, a chat app, a ticket system. With the ability to include real-time collaboration in the repo, it makes it possible to unify all of these things, ideally while keeping a full history. I basically want to version control my entire company, including what all of the non-devs are producing. Fossil has some of this capability, but it hasn't captured the mainstream: https://fossil-scm.org/home/doc/trunk/www/whyallinone.md - Make repos composable. It should be possible to include a repo in another repo in a way that isn't clunky. Submodules, subtrees and subrepos are clunky. A use case for this would be including a third party library as source. It should also be possible to take one piece of a repo, and distribute that "view" while allowing bidirectional contribution. An example use case for this would be for maintaining a public open source project simultaneously in the company monorepo and on a public forge. There are (very nice) hacks for this like https://github.com/google/copybara and https://josh-project.github.io/josh/ , but these have considerable clunk-factor. When repos can be sliced and glued like this, a lot of the monorepo vs polyrepo debate becomes unnecessary; we can have both. - Make it easy for everyone to use a patch stacking / "branchless" workflow with Diversion. There are numerous projects to enable stacking in git, and it's ubiquitous in big tech, yet it hasn't gone mainstream. It's only a matter of time until some company brings this to the masses. - Allow history to be viewed and maintained at varying granularity. As I'm sure you know, a common debate you will see unfolding online is between keeping a clean, manicured history, and keeping a full history of what you actually did. You see git forges try to split the difference by offering squash merges. You see people recommending --first-parent for viewing the logs without noise. To me, this all points to a pointless limitation of the tooling. Why can't I take the raw, messy, actual commit log of what I did, and then bundle those up into a non-destructive "summary" commit that appears in the log. That way, people can see the clean, summarised version of my change, but can also dive deeper and see all of the twists and turns I took while producing that change. There is so much room to improve version control. Much like build systems, I feel like the industry standard falls short of what we know is possible. I am happy to see new developements in this space.
In Launch HN: Diversion (YC S22) – Cloud-Native Git Alternative
I haven’t seen much info regarding their setup, aside from the bits about Pants and Bazel. Are those actually the upstream repositories, though? And is it known how they interact with them? Google has Copybara [1], which allows portions of a monorepo to live outside as an entirely separate repository without the need for things like Git submodules. It supports synchronization of histories, pull requests, path and file transformations, etc. In that sense, something like Copybara would allow them to, relatively, easily open source those bits, receive outside commits, and then sync the changes back to the monorepo. [1]: <https://github.com/google/copybara>
In Tesla engineers were on-site to evaluate the Twitter staff’s code, workers said
Facebook uses a monorepo, similar to the way Google does it. Dependencies are vendored and checked into the repo. Facebook has released a tool for migrating software between repos, which is much like Google's Copybara: Facebook's fbshipit: https://github.com/facebook/fbshipit Google's copybara: https://github.com/google/copybara With these tools, you can make fairly sophisticated choices about how you do vendoring. You can make the internal version look just like the public version, in terms of commit history. And you can export internal commits to public commits, stripping out confidential information along the way (or integrations with internal systems and tooling).
In Ask HN: State of PHP at Facebook?
In somewhat related news, Gerrit has a new frontend and it's awesome! Google has a couple of UX people working on it now and it shows. As a big fan of patch-based code review, I still can't stand GitHub PRs. It's very annoying to stack GitHub PRs, so the default is to create large PRs instead. This is sad, because smaller units of review result in better code! Gerrit solves this (and much more). Example change on Gerrit (click on "Comments"): https://gerrit-review.googlesource.com/c/gerrit/+/303182 Reasons to use Gerrit in spite of the learning curve: - Ability to review commit messages (they're part of the codebase!). - Show diffs between different versions of a change, even across rebases, with inline comments. - Inline comments aren't lost on rebases and will be ported. - Changes can be easily stacked. - Select code snippets for inline
Read the rest
comments, not just lines. - It's really fast and there's keyboard shortcuts for everything. - Rebase and cherry pick to release branches from the UI. Some projects like Go, Cue or SQLAlchemy use custom tooling or Copybara[1] to mirror PRs to Gerrit, which seems like the best of both worlds - simple PR workflow for drive-by contributions, patch workflow for core contributors who work with it all day. [1]: https://github.com/google/copybara
In Bzg/woof: online monitor for mailing list based patch workflow

Showing the 15 most recent of 21 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.