Is it possible to make Git aware of an existing .gitmodules file?

前端 未结 2 737
逝去的感伤
逝去的感伤 2021-02-13 05:57

I added a submodule:

git submodule add git://github.com/chneukirchen/rack.git rack

A file .gitmodules was created like:

         


        
2条回答
  •  梦如初夏
    2021-02-13 06:29

    You need to run

    git submodule update --init --recursive 
    

    UPDATE:

    the submodule add command actually clones the entire repo and adds the sha1 to the index.

    This may be new behaviour as compared to previous versions of git, the clone was not done immediately.

    If you don't have an entry in the index pointing the module to a particular commit, git submodule update refuses to do anything. This seems to be new behaviour.

    Hope this helps.

提交回复
热议问题