[英]Git submodule update after pull a brach
I'm trying to make update on submodules by that:我正在尝试通过以下方式更新子模块:
git submodule update --recursive
And the.gitmodules is:而.gitmodules 是:
[submodule "test"]
path = test
url = https://testuser@gitlab.org/test/test.git
Another developer has updated .gitmodules
on develop
branch like that:另一位开发人员在develop
分支上更新.gitmodules
:
[submodule "test"]
path = test
url = git@gitlab.org/test/test.git
I've followed these codes:我遵循了这些代码:
git pull origin develop
git checkout develop
git submodule update --recursive
I've checked the .gitmodules
file, it has changed, but it stil ask me the testuser's password.我检查了.gitmodules
文件,它已经改变了,但它仍然问我测试用户的密码。 I couldn't understand what have done wrong.我不明白做错了什么。
git submodule update
doesn't use .gitmodules
directly — it uses URLs from .git/config
copied there by git submodule init
. git submodule update
不直接使用.gitmodules
— 它使用git submodule init
从.git/config
复制的 URL。 When you need to update the URLs from changed .gitmodules
run git submodule sync
.当您需要从已更改的.gitmodules
运行git submodule sync
来更新 URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.