我尝试使用composer create-project vendor/name --repository=https://my.self-hosted-gitlab-instance.com/repository.git
命令创建项目。
当我运行命令时,我首先必须提交我的凭证:
Authentication required (my.self-hosted-gitlab-instance.com):
Username: myusername
Password:
我输入了正确的凭据,但我有:
[Composer\Downloader\TransportException]
Invalid credentials for 'https://my.self-hosted-gitlab-instance.com/myrepository.git/packages.json', aborting.
答案 0 :(得分:2)
如果您使用--repository
值的网址,则会将其视为类型为composer
的存储库。如果要使用不同的类型,则需要传递JSON女巫完整存储库配置:
composer create-project vendor/name --repository='{"type": "vcs","url": "https://my.self-hosted-gitlab-instance.com/myrepository.git"}'
或
composer create-project vendor/name --repository='{"type": "gitlab","url": "https://my.self-hosted-gitlab-instance.com/myrepository.git"}'
- 存储库:提供自定义存储库以搜索包,该包将用于代替packagist。可以是一个 指向
composer
存储库的HTTP URL,指向本地的路径packages.json
文件或类似于的JSON字符串 repositories密钥接受。