子模块的 Gitolite 镜像

标签 git gitolite

我尝试设置 Gitolite mirroring concept除了子模块之外,一切都工作正常。

当我从从服务器克隆存储库(具有子模块)并更新子模块时,子模块将从主服务器克隆。

如何使这些子模块也从从服务器克隆?

最佳答案

一种方法是,例如在接收后 Hook 中,确保 .gitmodules反射(reflect)了足够的子模块地址,通过 changing those submodules addresses ,后跟 git submodule sync

或者,请参阅“Git submodule url changed ”和新命令(Git 2.25+,2020 年第一季度)

git submodule set-url [--] <path> <newurl>

maxmelbin对象:

but changing .gitmodules means a new commit - right?

不一定:您可以进行该修改而不提交它,将其保持为纯粹的“私有(private)”(在您的从属服务器本地)。

Question was that since all repo's are mirrored in the slave, is there a way to automatically pick the local repo url during a submodule update, regardless of which sites url was configured in .gitmodules for that commit has

我认为--reference git submodule update的参数命令可以实现这一点。

--reference <repository>

This option is only valid for add and update commands.
These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git-clone(1) command.
NOTE: Do not use this option unless you have read the note for git-clone's --reference and --shared options carefully.

关于子模块的 Gitolite 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12067033/

相关文章:

git - 如何在没有服务器的情况下使用 tortoise git(本地单用户)

Git 子模块与依赖管理?

gitolite - 重击 : gitolite: command not found

git - 你如何在 VS 代码/Git 中撤消 "Discard all changes"

Github:显示包含提交的分支

git - HTTP 基本 : Access denied fatal: Authentication failed

apache - GitSmartHTTP for gitolite repositories over Apache 不允许我推送

git - git 可以在远程服务器上使用不同的语言环境吗?

Gitolite 在本地使用 gitolite 用户创建存储库

Gitolite 3 - 设置 repo 描述(未授权)