57

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:

enter image description here

The commit shows:

enter image description here

How can I add the laravel files to my github repo? Also, what is a subproject commit?

Flip
  • 6,233
  • 7
  • 46
  • 75
Connor Leech
  • 18,052
  • 30
  • 105
  • 150

2 Answers2

49

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)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
22

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.

Pang
  • 9,564
  • 146
  • 81
  • 122
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257