gpt4 book ai didi

git - 我可以在不 fork 的情况下覆盖嵌套 git 子模块的 URL 吗?

转载 作者:行者123 更新时间:2023-12-02 04:38:16 26 4
gpt4 key购买 nike

我有一个 Git 存储库,它使用第 3 方库的子模块。这个第 3 方库也使用子模块。

实际上,我在第 3 方子模块之一中发现了一个非常模糊的错误,这实际上是一个 2 行修复程序,以使其适用于我的情况。

如何在我的实际 Git 存储库中保留此更改,而不必 fork 第 3 方库、更新子模块 URL 并将其指向另一个 fork 以便我可以提交和修复错误?我可以覆盖我的 Git 存储库中的第 3 方子模块 URL 吗?

如果不可能,我可能最终会进行预构建事件以将我的文件版本复制到正确的位置,但这感觉非常hacky......但我不想维护两个 fork 总体上也可以正常工作的第 3 方库。

我知道我可以提出 pull 请求来修复错误,但假设作者不会对只修复我的特定情况的修复感兴趣,这不是不合理的 - 但是,我仍然想要这个在我的存储库中修复。

最佳答案

您询问

Can I override the 3rd party submodules URLs from my Git repository?



也许你要找的是这个:
git config submodule.SubModuleName.url PRIVATE_URL

Note

Since the URL in the .gitmodules file is what other people will first try to clone/fetch from, make sure to use a URL that they can access if possible. For example, if you use a different URL to push to than others would to pull from, use the one that others have access to. You can overwrite this value locally with git config submodule.DbConnector.url PRIVATE_URL for your own use. When applicable, a relative URL can be helpful.



来自 7.11 Git Tools - Submodules

关于git - 我可以在不 fork 的情况下覆盖嵌套 git 子模块的 URL 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39894103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com