简体   繁体   English

Git子模块:可以提供对子模块的https和ssh访问吗?

[英]Git Submodules: It is possible to provide both https and ssh access to submodules?

Is it possible to provide both https and ssh access to a git submodule? 是否可以同时提供对git子模块的https和ssh访问?

Some people might prefer to use https and some might only be able to use ssh (eg because they are behind an ssh tunnel). 有些人可能更喜欢使用https而有些人可能只能使用ssh(例如因为他们在ssh隧道后面)。

Is it possible to provide both options of fetching submodules? 是否可以提供两个获取子模块的选项?

You can use relative URL when referencing a submodule. 引用子模块时可以使用相对URL。

For example if you have an application repository: 例如,如果您有一个应用程序存储库:

  • git@example.org:project/app.git
  • or http://example.org/git/project/app.git http://example.org/git/project/app.git

and a library repository: 和库存储库:

  • git@example.org:lib/some-library.git
  • or http://example.org/git/lib/some-library.git , http://example.org/git/lib/some-library.git

then you can reference the library as ../lib/some-library.git instead of the full URL. 那么您可以将库引用为../lib/some-library.git而不是完整的URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM