从 Git 克隆后安装 FOSUserBundle

Install FOSUserBundle after cloning from Git

我已经在我的本地计算机上创建了我自己的网站,而且效果非常好。我在开发它时玩得很开心。但是当需要将它移到我的服务器并进行测试时,我 运行 遇到了问题。

我正在使用 FOSUserBundle。显然,作为它自己的 Git,当我执行 git 提交和推送时,git 忽略了 vendor/friendsofsymfony/user-bundle 中的所有内容。因此,当我克隆到我的服务器时,该文件夹是空的,当然现在我的网站无法运行。

我想以正确的方式做到这一点。因此,如果这意味着销毁 git 存储库并以不同的方式进行,我同意。

到目前为止我已经尝试过了。

  1. 按照 FOSUserBundle 的原始安装说明进行操作
  2. 运行以下:

    composer update friendsofsymfony/user-bundle

    composer install friendsofsymfony/user-bundle

两者都return"nothing to update/install"

我还尝试在每次命令尝试之间清除作曲家的缓存。

rm -rf ~/.composer/cache

听起来像你想做的是创建一个mywebsite父仓库,其中你有一个第三方子仓库FOSUserBundle 代码。这使用 git 子模块并需要相关的子模块命令,如 git submodule init.

The ... directory is there, but empty. You must run two commands: git submodule init to initialize your local configuration file, and git submodule update to fetch all the data from that project and check out the appropriate commit listed in your superproject...

我对作曲家一无所知。以下是使用 git 的方法。

cd mywebsite
git init
git submodule add <url-to-FOSUserBundle-repo>

您现在应该具有如下目录结构:

 mywebsite
     .git
     .gitmodules
     FOSUserBunder
         .git

另见 http://git-scm.com/book/en/v2/Git-Tools-Submodules

答案在评论里。忽略供应商/使用 composer 安装适当的文件。

还有这个