Fatal Error when updating submodule using GIT

后端 未结 8 918
庸人自扰
庸人自扰 2021-01-30 08:45

I am trying to update the submodules of this git repositary but I keep getting a fatal errors:

[root@iptlock ProdigyView]# git submodule update --recursive
Cloni         


        
相关标签:
8条回答
  • 2021-01-30 09:39

    The issue is that git can't find the public key needed to download the repo from your server, the solution is to use the public url.

    In the file .gitmodule you will find the following entry:

    [submodule "example"]
        path = example
        url = git@github.com:webhat/example.git
    

    The URL need to be changed to the public URL for the module:

    [submodule "example"]
        path = example
        url = https://github.com/webhat/example.git
    

    As you can see the prefix git@ has been changed to https:// and the infix : becomes /

    EDIT: In your own repository you might need to use git:// rather than https://

    The previous answer was unclear to me, so I added this.

    EDIT 2: If you find you need to run git submodule sync or need to edit .git/config to get this to work, you have likely set up remotes for the submodules.

    0 讨论(0)
  • 2021-01-30 09:39

    Figured it out. The path in the .gitmodule files could not download the submodule.

    0 讨论(0)
提交回复
热议问题