Github 引用子模块 - 错误的树
Github referencing a submodule - Wrong tree
我在看别人的回购。它里面有一个文件夹,我相信它是一个引用的子模块。它的名字是这样的:
网站@5afa940
有一个名为 .gitmodules 的文件,其内容为:
[submodule "website"]
path = website
url = git@github.com:xyz/website.git
branch = master
如果 .git 模块正在引用 master 分支,为什么在 github 中我仍然可以看到与 master 树引用不同的文件夹引用?
我是否可以通过 github 在线进行调整,或者我是否需要使用 git 命令行?
If the .gitmodule is refencing the master branch why in GitHub can I still see a folder reference with a different tree reference than master?
因为子模块总是引用 SHA1
"master" 分支规范仅在您使用
时存在
git submodule update --remote
有关更多信息,请参阅“Git submodules: Specify a branch/tag" and "git submodule tracking latest”。
在本地克隆和更新 (--remote
) 后,gitlink (special entry in the index) will be changed (to the latest fetched SHA1 of origin/master
for the submodule upstream repo) 记录的 SHA1)。
然后,您将能够 git 添加并 git 将该新引用推回到 GitHub。
只有这样 GitHub 才会显示更新的 SHA1。
我在看别人的回购。它里面有一个文件夹,我相信它是一个引用的子模块。它的名字是这样的:
网站@5afa940
有一个名为 .gitmodules 的文件,其内容为:
[submodule "website"]
path = website
url = git@github.com:xyz/website.git
branch = master
如果 .git 模块正在引用 master 分支,为什么在 github 中我仍然可以看到与 master 树引用不同的文件夹引用?
我是否可以通过 github 在线进行调整,或者我是否需要使用 git 命令行?
If the .gitmodule is refencing the master branch why in GitHub can I still see a folder reference with a different tree reference than master?
因为子模块总是引用 SHA1
"master" 分支规范仅在您使用
时存在git submodule update --remote
有关更多信息,请参阅“Git submodules: Specify a branch/tag" and "git submodule tracking latest”。
在本地克隆和更新 (--remote
) 后,gitlink (special entry in the index) will be changed (to the latest fetched SHA1 of origin/master
for the submodule upstream repo) 记录的 SHA1)。
然后,您将能够 git 添加并 git 将该新引用推回到 GitHub。
只有这样 GitHub 才会显示更新的 SHA1。