我有一个子模块跟踪一个分支。它目前正担任该分支机构的负责人。但是git submodule status想出了一个相当丑陋的标签。
在子模块和远程中,该提交实际上都是所讨论分支的当前头。
% git submodule status
168b1e6c54101dfa7b1b865197ab7ac660c56fcf common (tha-6-7-g168b1e6)
% cat .gitmodules
[submodule "common"]
path = common
url = git@github.com:basis-technology-corp/perceptron-segmentation-models.git
branch = etrog-985-restructure丑陋的字符串“tha-6-7-g....”从何而来?它不是分支顶部提交的标记。
发布于 2013-10-01 06:03:41
您的子模块跟踪一个分支,是的:它是registered in the .gitmodules file。
git config -f .gitmodules submodule.<path>.branch但是submodule true nature没有改变:它的角色仍然要在父回购中引用--一个固定的提交SHA1。这就是git submodule status所显示的内容,并保证其他克隆您的回购程序的人最终将获得与您当前看到的子模块相同的子模块。
git submodule status显示子模块的状态。这将打印每个子模块当前签出的提交的SHA-1,以及SHA-1的子模块路径和git describe的输出。
只有当您执行git submodule update --remote时,它的SHA1才会更改,以反映远程分支的最新情况。
然后,您需要提交父回购,以便注册子模块的新SHA1。
父回购总是引用子模块SHA1,而不是子模块分支。
分支名称可以来来去去,可以重命名或删除。这不应影响父级回购恢复子模块的确切内容的能力。
https://stackoverflow.com/questions/19101504
复制相似问题