[英]Composer Use Local Git Bundle As it Would a Git Repo
我有一个方案,其中要部署的计算机无法直接访问Git存储库。 因此,解决方案是将回购的Git捆绑包本地复制到将部署代码的计算机上。
所以看起来像这样。
/var/local/repos/MyGitRepo/MyGitRepo.git
如果我想在普通的git客户端上使用它,我可以做
git clone /var/local/repos/MyGitRepo/MyGitRepo.git MyGitRepo
我在MyGitRepo目录中签出了MyGitRepo。
我的问题是,当我使用作曲家安装MyGitRepo时,必须参考MyGitRepo签出的Git存储库,而不是/var/local/repos/MyGitRepo/MyGitRepo.git
因此存储库如下所示:
{
"type" : "vcs",
"url" : "/where/i/put/MyGitRepo"
}
这可行,但是我不能仅将作曲家指向git repo而不是签出的git repo吗?
我觉得这应该工作:
{
"type" : "vcs",
"url" : "/var/local/repos/MyGitRepo/MyGitRepo.git"
}
我得到这个问题的报告。
找不到任何版本的请求的软件包mygitrepo,软件包名称中可能有错字。
如果我必须将作曲家指定为已签出的本地存储库,那很好,但是看来我应该能够像使用任何Git存储库一样使用该.git包。
您可以使用repo的path
类型在供应商文件夹中创建一个指向链接的符号链接。 来自文档:
{
"repositories": [
{
"type": "path",
"url": "/var/local/repos/MyGitRepo/MyGitRepo.git"
}
],
"require": {
"my/package": "*"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.