带有子模块的common mistake是在超级项目中提交一个子项目哈希,指向使用超级项目的每个人都无法访问的提交(例如,提交可能只存在于某人的个人计算机上。)< / p>
我想审核整个历史记录,以确保超级项目引用的每个子项目提交实际存在于给定的远程存储库中。有没有办法做到这一点?
答案 0 :(得分:1)
您可以尝试执行检查的GitHub project git-pre-push-submodule-check
(来自Konrad Malawski aka ktoso)(ruby脚本):
从现在开始,您可能希望使用pom而不是其他推送方法,以下是它的外观:
当您在子模块中进行未按下的更改时:
$ git pom
Checking [styles-common] submodule for unpushed commits...
**********************************************************
You have 2 unpushed commits within styles-common:
1a87491 added more fluffy icons
bd40c09 flash now has nice round corners
**********************************************************
Aborting push.
如果子模块中没有未按下的更改:
$ ./check_submodule_pushed.rb
Checking [styles-common] submodule for unpushed commits...
Seems all submodule commits you refer to are reachable, let's push!
但我的观点是:我不知道在推送其父级仓库之前检查子模块是否已被推送的本地方式。