2

I have a project on my git repo.

I add a submodule (a project in github) to this project. And when I do git status I see the complete added project with all of its content as a file, and not as diferent files. Why happens this?

the folder as file

Iker Aguayo
  • 3,980
  • 4
  • 37
  • 49

1 Answers1

1

What you see is the gitlink (a special entry in the index) representing the SHA1 recorded for your submodule.

When you add a submodule, you add a "file" (gitlink), that you need to commit and push.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • After doing commit and push I did a change in a class of this folder, and I see again the whole gitlink and not that class to "add and commit". Why? – Iker Aguayo Jul 12 '15 at 13:17
  • 1
    @IkerAguayo Because, from the parent repo perspective, all you see is a SHA1 recording the new state of the subrepo (see http://stackoverflow.com/a/17442045/6309). You would see add and commit only from within the subrepo folder. Which is why you need to push your subrepo changes first, or the SHA1 recorded by the parent repo would reference a non-existing reference. – VonC Jul 12 '15 at 13:18