2017-04-18 35 views
1

我在依赖作曲家的drupal中使用imgix模块。当我运行命令drush composer-manage install时,我可以看到imgix-php(imgix库)被下载到供应商目录中。我已经正确设置了一切,它在我的本地主机上运行良好。现在我想把它们推入github。我可以看到没有imgix-php的文件在git中添加,它在github中是emty。然后我看到有一个文件.gitignoreimgix-php其中vendor被写入。但是,我已经评论过了。但无法添加imgix-php的任何文件。如果我注释掉线.gitignorevendor并检查其状态,它显示我为:无法将所有文件添加到通过作曲家下载的git

On branch staging 
Your branch is up-to-date with 'origin/staging'. 
Changes not staged for commit: 
(use "git add <file>..." to update what will be committed) 
(use "git checkout -- <file>..." to discard changes in working directory) 
(commit or discard the untracked or modified content in submodules) 

modified: sites/all/vendor/imgix/imgix-php (modified content) 

no changes added to commit (use "git add" and/or "git commit -a") 

能告诉我这样的人为什么不能添加。

+1

通常情况下,您会让/ vendor在.gitignore中被阻止,并将您的composer.lock提交到回购站。任何从repo安装的人都会'composer install'从源头获取库。 https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md – markdwhite

+0

实际上我的生产服务器从github中提取。所以我应该在git中添加完整的源代码。有什么方法可以添加通过作曲者下载的所有文件? – StreetCoder

+0

该链接(通常在getcomposer.org网站上)有指导,可能会对您有所帮助。这是在“如果你真的觉得你必须这样做,你有几个选择”部分“ – markdwhite

回答

0

你有没有实际添加的imgix-PHP文件,你的评价文件的.gitignore后,使用

git add /path/to/folder/* 

git add --all /path/to/folder