github 与其他存储库链接

发布于 2025-01-06 20:01:12 字数 144 浏览 3 评论 0原文

我有一个项目依赖 github 中的两个存储库来运行。 当我将项目提交到 github 时,如何链接到这两个存储库? 我应该在自己的存储库中复制文件,还是链接到特定版本的其他存储库,因为我不希望它更新并导致不兼容。 我已经创建了我的 github 存储库,我应该做什么?

I have a project that relies on two repos in github to function.
When I submit my project to github how do I link to these two repos?
Should I duplicate the files in my own repo or link to the other repo at a specific revision as I don't want it to update and cause incompatibility.
I already created my github repo what should I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

像极了他 2025-01-13 20:01:12

您可以使用 git 子模块“链接”到其他项目。

请参阅此处 - https://github.blog/2016-02-01-使用子模块/

You can use git submodules to "link" to other projects.

See here - https://github.blog/2016-02-01-working-with-submodules/

双马尾 2025-01-13 20:01:12

我发现有一个更实用的子模块替代方案: 子树

根据这个链接,优点是:

  • 管理简单的工作流程很容易。
  • 支持旧版本的 git(甚至在 v1.5.2 之前)。
  • 克隆超级项目完成后,子项目的代码立即可用。
  • 子树不需要您的存储库的用户学习任何新内容,他们可以忽略您使用子树来管理依赖项的事实。
  • 子树不会像子模块 doe(即 .gitmodule)那样添加新的元数据文件。
  • 可以修改模块的内容,而无需在其他地方拥有依赖项的单独存储库副本。

There is an alternative to submodules that I found out to be more practical: subtree.

According to this link the advantages are:

  • Management of a simple workflow is easy.
  • Older version of git are supported (even before v1.5.2).
  • The sub-project’s code is available right after the clone of the super project is done.
  • subtree does not require users of your repository to learn anything new, they can ignore the fact that you are using subtree to manage dependencies.
  • subtree does not add new metadata files like submodules doe (i.e. .gitmodule).
  • Contents of the module can be modified without having a separate repository copy of the dependency somewhere else.
如梦亦如幻 2025-01-13 20:01:12

GitHub 还允许您在 GitHub 上的评论或提交中引用另一个存储库。例如:

We should probably handle this with github/enterprise#59

这将添加对问题 github/enterprise#59 的更新,并包含指向您的评论/提交的链接。

跨存储库问题参考

在此处输入图像描述

当然,GitHub 是关于社交编码的,但您也可以拥有社交存储库。您可以通过在问题中提及 user/repository#number 来引用存储库之间的问题。一旦我们看到类似的内容(例如 github/enterprise#59),我们将确保更新 github 企业存储库中的问题 #59,并让您知道它的引用位置。这是 GitHub Flavored Markdown 的一部分,它也有自己的一些技巧.

了解更多:https://github.com/blog/967-github-secrets

GitHub will also allow you to reference another repository in a comment on GitHub or in a commit. For example:

We should probably handle this with github/enterprise#59

This will add an update to the issue github/enterprise#59 with a link to your comment/commit.

Cross-Repository Issue References

enter image description here

Sure, GitHub's all about social coding, but you can have social repositories, too. You can reference issues between repositories by mentioning user/repository#number in an issue. Once we see something like that — say, github/enterprise#59 — we'll make sure to update issue #59 in github's enterprise repository and let you know where it was referenced from. This is a part of GitHub Flavored Markdown, which also has a few tricks of its own.

Read more: https://github.com/blog/967-github-secrets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文