How do I fetch/re-push a submodule in git?

前端 未结 1 902
耶瑟儿~
耶瑟儿~ 2021-01-16 02:40

In my git repository (Bitbucket) I have a reference to a sub project.

When I pushed it on the first place a .git/ folder was included (even though I use the reposito

相关标签:
1条回答
  • 2021-01-16 03:31

    As I explained this morning in "How to solve this Git issue?", this (ie '<folder_name> → <SHA> [<SHA>]') is not a submodule.

    A submodule is composed of:

    • a remote repo url (stored in a file called .gitmodules)
    • a SHA1 recorded as a gitlink (special entry in the index)

    If you record only the SHA1, but not the url, you will have something like:

    A git clone --recursive won't be able to clone the repo with that SHA1, because it does not know its url.

    If you want to reference a subproject as a submodule:

    • read Git Submodules, and
    • use git submodule add https://...
    0 讨论(0)
提交回复
热议问题