Is there a way to `git submodule add` a repo *without* cloning it?

前端 未结 3 1705
说谎
说谎 2021-02-04 05:49

I have a very long list of repos that I\'m trying to make into one parent repo by making them all submodules.

I\'ve tried adding them to .gitmodules manual

3条回答
  •  生来不讨喜
    2021-02-04 06:41

    Just use git add.

    The git submodule command is just there to help wrangle nested repositories.

    Some people prefer simple abstractions that dictate and limit what can be done with arbitrarily complicated concrete implementations.

    Git prefers simple implementations that can be made to do unlimited, arbitrary things, relegating abstractions to their proper role as assistants, ways of talking about what's possible. Trying to fit all the things you can do with a dag of snapshots into the blinkered straitjacket of vcs abstractions is crazy-making. A submodule is just a dag reference. "Put the tip of this dag here". The submodule command is just tools to help you hunt down a source for that dag and protect it from all the violent things you do to your poor overworked filesystem every day.

提交回复
热议问题