git - 如何使用远程 git-repos 进行 git clone --reference

标签 git

我想使用缓存加速网络中一些 git-repos 的克隆。 我设置了存储库并运行 git-daemon。

现在我可以打电话了

git clone git://my_ip/my_repo

失败的是

git clone --reference git://my_ip/my_repo git://github.com/my_repo.git

fatal: path 'git://my_ip/my_repo' does not exist

有没有办法将远程存储库用于--reference? 或者我需要本地引用吗?

最佳答案

--reference 仅与本地存储库有关。请参阅 https://git-scm.com/docs/git-clone#git-clone---reference-if-ableltrepositorygt 处的文档:

If the reference repository is on the local machine, automatically setup .git/objects/info/alternates to obtain objects from the reference repository.

关于git - 如何使用远程 git-repos 进行 git clone --reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46552380/

相关文章:

git - 如何匿名提交对 Git 存储库的更改

git - 更改 Jenkins 的 github 凭据

git - 文件权限和所有者是 :group properties included in git commits?

git - 我如何获得 Git 提交计数?

git - 如何获取其他人的 pull 请求(修复它)

node.js - npm安装解压报错

java - MVN 没有创建带有阴影的 Fat Jar

git - 是否可以从 `git push` 中排除文件,但将它们保留在本地存储库中?

GitLab:如何判断我对项目的访问级别?

克隆存储库时 Git 冲突复制错误