分叉的GIT子模块,并更改了源URL。但克隆仍拉动旧的源URL? [英] Forked GIT submodule, and changed source URL. But clone still pulls old source URL?

查看:139
本文介绍了分叉的GIT子模块,并更改了源URL。但克隆仍拉动旧的源URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的git项目中有一个子模块,我已经对其进行了一些更改,并上传到我自己的git服务器中进行分叉。我已经将master git仓库中的源URL更改为新的子模块位置,并运行 git submodule sync ,所以我的 .git / config 文件是最新的。然后我将所有内容都推送到Bitbucket,在那里存储数据。但是,当我克隆我的主git存储库时,它仍然从旧位置拉下子模块的数据。任何想法可能会导致这种情况发生,以及如何解决它?当我克隆版本库时,我的分支更改不会出现。

解决方案

很可能您的.gitmodules文件不正确。 你用你的文本编辑器打开它,你会看到如下所示: b path = externals / submodule
url = git@github.com:Original / repo.git

将url更改为更新的位置,重新运行 git子模块同步,您应该很好。


I have a submodule in my git project, which I have made some changes to, and uploaded to my own git server to fork it. I've changed the source URL in the master git repository to the new submodule's location, and ran git submodule sync so my .git/config file is up to date. Then i pushed everything to Bitbucket, where my data is stored. However, when I clone my main git repository, it is still pulling down the data for the submodule from the old location. Any idea what might be causing this to happen and how to fix it? It's making my forked changes not come up when I clone the repository.

解决方案

Most likely your .gitmodules file is incorrect.

If you open it with your text editor, you will see something like this:

[submodule "externals/submodule"]
    path = externals/submodule
    url = git@github.com:Original/repo.git

Change the url to the updated location, rerun the git submodule sync and you should be good to go.

这篇关于分叉的GIT子模块,并更改了源URL。但克隆仍拉动旧的源URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆