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 subproject is a generic term for one of three types of nesting: Submodules provide semi-fixed references from the superproject into subprojects and are integrated into git.
A git submodule is a record within a host git repository that points to a specific commit in another external repository. Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.
Subrepositories is a feature that allows you to treat a collection of repositories as a group. This will allow you to clone, commit to, push, and pull projects and their associated libraries as a group.
Git submodules may look powerful or cool upfront, but for all the reasons above it is a bad idea to share code using submodules, especially when the code changes frequently. It will be much worse when you have more and more developers working on the same repos.
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 means the repository uses Submodules.
To pull down the Laravel code, try
git submodule init git submodule update
Submodules are notoriously prickly; I recommend reading up on them before working too much on a project that uses them. The link above should be a good starting point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With