如何强制Composer使用https://而不是git://? [英] How to force Composer to use https:// instead of git://?
本文介绍了如何强制Composer使用https://而不是git://?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这样的
"repositories": [
{
"type": "package",
"package": {
"name": "myrepo",
"version": "dev-master",
"source": {
"url": "https://github.com/me/myrepo.git",
"type": "git",
"reference": "master"
}
}
},
但是当Composer拉取仓库时, .git / config
中的 origin
和 composer
git://github.com/me/myrepo.git
。
But when Composer pulls the repo, the remotes (origin
and composer
) in .git/config
are set up as git://github.com/me/myrepo.git
.
[remote "origin"]
url = git://github.com/me/myrepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
pushurl = git@github.com:me/myrepo.git
[branch "master"]
remote = composer
merge = refs/heads/master
[remote "composer"]
url = git://github.com/me/myrepo.git
fetch = +refs/heads/*:refs/remotes/composer/*
我无法推送它,因为Github不能使用 git://
。我必须手动将此更改为 https://
,然后按。我在网址中指定了 https://
,但为什么不这样呢?
I can't push to it, because Github doesn't work with git://
. I have to manually change this to https://
and then push. I specified https://
in the URL, but why isn't this respected?
推荐答案
您可以使用此命令更改用于github的协议:
You can change the protocol used for github with this command:
composer config --global github-protocols https
然后重新安装供应商应该做你想要的。
Then re-installing vendors should do what you want.
这篇关于如何强制Composer使用https://而不是git://?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文