【问题标题】:Using Composer/Installers for Cakephp, how do I Commit Dependencies in my Plugin Directory?使用 Cakephp 的 Composer/Installers,我如何在我的插件目录中提交依赖项?
【发布时间】:2014-11-10 22:59:39
【问题描述】:

我想要两全其美:主项目管理的 git 和 CakePHP 插件管理的 composer。我知道这是一个目前非常不愉快的话题,但对我来说这是最好的解决方案。

我将 Composer Installers 用于 CakePHP。我想使用 Composer 常见问题解答中列出的选项 4 中描述的设置: https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md

这里引用的是:

添加 .gitignore 规则 (vendor/.git) 以忽略所有供应商 .git 文件夹。此方法不需要您删除依赖项 在运行作曲家更新之前从磁盘中获取。

由于我将 Composer Installers 包与 CakePHP 一起使用,因此这些包将位于“Plugin”文件夹中。

我尝试将以下内容添加到 .gitignore 以便我可以将插件提交到主项目:

Plugin/.git
Plugin/**/.git

但是,唉,git 仍然将我的 Composer 安装程序包视为子模块,并且不会将插件提交到主项目。

似乎上面的 .gitignore 行就足够了,所以我必须遗漏一些东西才能让这个设置正常工作,对吧?

提前致谢!

【问题讨论】:

标签: git cakephp installation composer-php


【解决方案1】:

你试过git add . --all然后git commit --all吗?

您好像有一个新文件,通常人们会使用git add 手动添加它,但是将所有文件添加到插件文件夹中会花费很多时间。

【讨论】:

  • 我尝试添加 --all 标志,但没有成功。
  • 删除那几行,git会自动忽略.git文件夹。
  • 我试过了。 git 仍然将它们视为子模块,这是我不想要的。
猜你喜欢
  • 2015-02-24
  • 1970-01-01
  • 2012-01-28
  • 1970-01-01
  • 2012-06-05
  • 2015-07-14
  • 1970-01-01
  • 2016-04-01
  • 2022-08-14
相关资源
最近更新 更多