gpt4 book ai didi

git - 用自己的 fork 交换 git 子模块

转载 作者:IT王子 更新时间:2023-10-29 01:07:29 26 4
gpt4 key购买 nike

我像这样在我的 git 仓库中添加了一个子模块:

$ git submodule add git://github.com/user/some-library some-library

我决定创建一个该库的分支来进行一些调整。我如何交换该子模块,使其指向我自己的 github 分支?

最佳答案

子模块存储在.gitmodules中:

$ cat .gitmodules
[submodule "ext/google-maps"]
path = ext/google-maps
url = git://git.naquadah.org/google-maps.git

如果您使用文本编辑器编辑 url,则需要运行以下命令:

$ git submodule sync

这会更新 .git/config,其中包含此子模块列表的副本(您也可以只编辑 .git/的相关 [submodule] 部分手动配置)

虽然 submodule 系统似乎有点不完整(例如,参见 the instructions to remove a submodule)

关于git - 用自己的 fork 交换 git 子模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11637175/

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