TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Git-subcopy lets you link files across repositories

110 点作者 jD91mZM2超过 5 年前

7 条评论

jD91mZM2超过 5 年前
I believe there&#x27;s some confusion around what git-subcopy does. It doesn&#x27;t actually preserve history or anything like it. It just clones a certain file into your repository as a new commit, while saving which revision the file is from.<p>A potentially good candidate for using git-subcopy would be on this file: <a href="https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;rnix-parser&#x2F;blob&#x2F;master&#x2F;benches&#x2F;all-packages.nix" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;rnix-parser&#x2F;blob&#x2F;master&#x2F;ben...</a>. It&#x27;s copy-pasted from the nixpkgs upstream repository. It can&#x27;t be used as a submodule - it&#x27;s just one file out of dozens, no way people want to clone all that. Even worse with subtree, that&#x27;ll <i>always</i> clone the whole upstream repo, and pollute the history on top of that. But the way it is currently, there&#x27;s also no hint where it comes from.<p>git-subcopy is basically just me imagining a solution where you can not only link files or directories between repos without bloating down code size or history, but also modify them and later check what modifications you&#x27;ve made and rebase them. If you don&#x27;t have a use case for this tool, good for you!
AlotOfReading超过 5 年前
Every so often I find it necessary to move things from one repo to another and preserve history along the way. I&#x27;ve made do with a janky shell script that recreates all the commits touching relevant files in the new repo, but this looks like a much less sketchy way to do it. It even sends changes back to the original repo if I understand the code right.
评论 #21370700 未加载
评论 #21370934 未加载
apostacy超过 5 年前
I like this idea and want to know more, but I wish the README.md actually told us how and what, instead of just why. I didn&#x27;t want to watch an asciicast.
评论 #21370455 未加载
narnianal超过 5 年前
What&#x27;s the architecture of this idea? Is there a reasonable assumption that it would keep the complexity for maintainers low in 3+ repos having a relationship with each other? If so, how?
评论 #21370595 未加载
dmoose超过 5 年前
I was looking at this for a similar use case <a href="https:&#x2F;&#x2F;bit.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bit.dev&#x2F;</a>
jesse_m超过 5 年前
Is this similar to Android repo tool?
评论 #21370615 未加载
polyterative超过 5 年前
Hell I want this to be a standard