[英]Composer - Add a specific folder of a git repository as dependency
I know that you can use git repositories as a dependency with composer. 我知道您可以将git存储库用作composer的依赖项。 However I am wondering if I can add a specific folder of a git repo as a dependency.
但是我想知道是否可以添加git repo的特定文件夹作为依赖项。 For instance the Add Meta Tags Mod of Wordpress is in a shared repo: https://github.com/svn2github/wordpress-vip-plugins/tree/master/add-meta-tags-mod
例如,Wordpress的Add Meta Tags Mod在共享仓库中: https : //github.com/svn2github/wordpress-vip-plugins/tree/master/add-meta-tags-mod
Can I set Composer to only download the add-meta-tags-mod
folder? 我可以将Composer设置为仅下载
add-meta-tags-mod
文件夹吗?
It would be easier to use source SVN - git does not support partial checkouts, so it may be hard to get this with git repo while it is quite easy with SVN: 使用源SVN会更容易-git不支持部分检出,因此使用git repo很难做到这一点,而使用SVN则很容易:
{
"require": {
"wordpress-vip-plugin/add-meta-tags-mod": "dev-master"
},
"repositories": [
{
"type": "package",
"package": {
"name": "wordpress-vip-plugin/add-meta-tags-mod",
"version": "dev-master",
"source": {
"url": "https://vip-svn.wordpress.com/plugins/add-meta-tags-mod/",
"type": "svn",
"reference": "/"
}
}
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.