什么是子项目提交?

时间:2014-01-13 10:18:50

标签: git github

我正在尝试将Laravel文件添加到Github存储库中。

我跑了

$ git clone https://github.com/laravel/laravel.git

文件在本地显示正常但在我推送到github时不显示:

enter image description here

提交显示:

enter image description here

如何将laravel文件添加到我的github repo?另外,什么是子项目提交?

2 个答案:

答案 0 :(得分:26)

子模块提交是一个 gitlink special entry recorded in the index,是在您的回购添加子模块时创建的;

它记录父仓库当前引用的SHA1。

git submodule update --init 足以填充回购邮件中的laravel子目录。

填写后,请注意您的子模块仓库位于detached HEAD mode

As shown here,当在父仓库中切换分支时,你的子模块gitlink会相应地改变,但是你的子模块内容不会改变,直到再次进行git子模块更新(在git checkout之后)< / p>

答案 1 :(得分:12)

这意味着存储库使用Submodules

要下拉Laravel代码,请尝试

git submodule init
git submodule update

子模块众所周知是多刺的;我建议在使用它们的项目上工作太多之前先阅读它们。上面的链接应该是一个很好的起点。

相关问题