Working with Git submodules without .gitmodules

I’m interested in the specific case where you manually place one Git repository inside another Git repository (either by using git clone or by copy-pasting in the filesystem). I’ve noticed the following things happen when you do this:

  1. Git will save a pointer to a specific commit, like with a submodule.
  2. Git will not allow you to modify the contents of the subproject from within the
    superproject, like with a submodule.
  3. git clone on the superproject will not copy the subproject contents,
    like with a submodule.
  4. git submodule will not work. It complains about .gitmodules not being
    there.

I would like to know:

  • What does .gitmodules do? It’s absence is the only obvious difference between a
    manual copy like this and a true submodule.
  • Is there any other difference I don’t know about?
  • Does this manually-copied state have a special name?
  • Is there any way to override and/or work around effects 3 and 4? (IE: I want to
    render the resulting repository fully usable)

  • Using someone else's repo as a Git Submodule on GitHub
  • Git submodule remote server
  • How to hook a git submodule?
  • How to change git submodule tracking remote branch?
  • How to discard change to git submodule?
  • Why are git submodules incompatible with svn externals?
  • How do I revert my changes to a git submodule?
  • Latest Jenkins not cloning submodule
  • One Solution collect form web for “Working with Git submodules without .gitmodules”

    I think the only difference is a submodule has a relation with its parent. For instance, you can use --recursive option when cloning to fetch all the submodules at a time. Otherwise, you’d have to fetch them all one by one.

    Git Baby is a git and github fan, let's start git clone.