I have the following in my Laravel 5.1 projects composer.json to add a public github repository as a dependency.
...
"repositories": [
{
"type": "package",
"package": {
"name": "myVendorName/my_private_repo",
"version": "1.2.3",
"source": {
"type" : "git",
"url" : "git://github.com/myVendorName/my_private_repo.git",
"reference" : "master"
},
"dist": {
"url": "https://github.com/myVendorName/my_private_repo/archive/master.zip",
"type": "zip"
}
}
}
],
"require": {
....
"myVendorName/my_private_repo": "*",
},
...
只要存储库是公共的,这种方法就有效.现在我已经将这个存储库设置为private.我用来拉/推到"my_private_repo"的git凭证是该项目的合作伙伴之一.当我运行composer update或composer install时,如何实现composer从私有存储库中提取数据?