什么是子项目提交? [英] What is a subproject commit?
问题描述
我试图将Laravel文件添加到Github库中。
我跑了
$ git clone https://github.com/laravel/laravel.git
这些文件在本地显示正常,但当我推送到github时,不会显示:
提交显示:
如何将laravel文件添加到我的github库中?此外,什么是子项目提交?
子模块提交是 gitlink ,记录在索引中的特殊条目,当您将子模块添加到回购库时创建;
它记录父目录回购目前引用的SHA1。
一个 git子模块更新--init
足以填充您的仓库中的laravel子目录。
完成填充后,请注意您的子模块回购库位于分离的HEAD模式。
如此处所示,当在父回购中切换分支时,您的子模块gitlink会相应地改变,但你的子模块内容不会改变,直到你再次进行git子模块更新(在 git checkout code>)
I'm trying to add the Laravel files to a Github repo.
I ran
$ git clone https://github.com/laravel/laravel.git
The files show up fine locally but do not show up when I push to github:
The commit shows:
How can I add the laravel files to my github repo? Also, what is a subproject commit?
A submodule commit is a gitlink, special entry recorded in the index, created when you add a submodule to your repo;
It records the SHA1 currently referenced by the parent repo.
A git submodule update --init
is enough to populate the laravel subdirectory in your repo.
Once it is filled, note that your submodule repo is in a detached HEAD mode.
As shown here, when switching branches in the parent repo, your submodule gitlink will change accordingly, but your submodule content won't change until you make again a git submodule update (after the git checkout
)
这篇关于什么是子项目提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!