2

サブモジュールを含むリポジトリのクローンを作成したいと考えています。

この質問--recursiveでオプションについて学びましたが、この解決策では、クローン作成ホストからサブモジュール リポジトリにアクセスできる必要があります。

サブモジュールをアクセス可能なホストから直接複製するためのスイッチはありますか?

理論的にはサブモジュールのリポジトリに到達できる https プロキシがありますが、クローニング ホストには必要な証明書がインストールされていません。そのため、特定の https 証明書をユーザー空間にインストールする方法を見つけることも解決策になる可能性があります。

4

1 に答える 1

2

If the remote server (host1 in your comment) would have to execute a clone or fetch on your behalf, then no, you can't do this.

However, since the submodules are themselves repositories, you could use them directly if they are cloned on host1. After you clone the main repository, edit the .gitmodules file and change the Github URLs to the corresponding subdirectories of host1:mainrepo:

[submodule "submod1"]
        path = extern/sub1
        url = git://github.com/user/myproject

changes to

[submodule "submod1"]
        path = extern/sub1
        url = host1:git/mainproject/extern/sub1

You can then use the git submodules commands to work with them.

(You'll have to be careful though: don't commit your changes to .gitmodules or push commits into the submodules on host1 unless you really mean to!)


For your alternative question, check out the Git config settings http.proxy and http.sslCert. You should be able to provide a certificate file directly using the latter, without having to "install" it in the system CA path.

于 2012-09-11T19:36:36.610 に答える