2

I tried using submodules to keep a copy from github repository inside my 3rd party directory. After creating and fetching the files, when I commit from project it only see the folder, no the files (and yes, the files are there).

Is there a specific command?

Erick Engelhardt
  • 704
  • 2
  • 10
  • 30

1 Answers1

0

On GitHub, you will only see a gray folder: it is the gitlink special entry in the index, recording the SHA1 of said submodule.

On your local clone, as long as you do a

git submodule update --init

You will see the full content of the submodule.

But when you push, yuo must push from:

  • the submodule folder, in order for the submodule upstream repo to record your new commit
  • go back to the parent repo (cd ..), add, commit and push the new gitlink state (which records the new SHA1 of your submodule): that is what updates the "gray folder" in your GitHub repo when you push from your local clone.
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250