1

I am using imgix module in drupal which is dependent on composer. When I run command drush composer-manage install, I can see imgix-php (a library of imgix) is downloaded in vendor directory. I have setup everything correctly and it works well in my localhost. Now I want to push them into github. I can see none of file of imgix-php is added in git and it is emty in github. Then I have see there is a file .gitignore in imgix-php where vendor is written. However, I have commented it out. But unable to add any files of imgix-php. If I commented out the line vendor of .gitignore and check the status, it shows me as:

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")

Could tell me someone why I can't add them.

StreetCoder
  • 9,871
  • 9
  • 44
  • 62
  • 1
    Normally you would leave /vendor blocked in .gitignore, and commit your composer.lock to the repo. Anyone installing from the repo would then 'composer install' to get the libraries from source. https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md – markdwhite Apr 18 '17 at 06:23
  • actually my production server pulls from github. So I should to add the full source in git. Is there any way to adding all the files which are downloaded via composer? – StreetCoder Apr 18 '17 at 06:35
  • There is guidance in that link (and generally on the getcomposer.org website) that might help you further. It's under the section "If you really feel like you must do this, you have a few options" – markdwhite Apr 18 '17 at 06:54
  • @StreetCoder Just a thought in case you haven't checked, be sure you don't have `vendor` configured in a global gitignore. i.e. `~/.gitignore`. Also, is the drupal root the root of your repository? Not sure where your `.gitignore` file is, but make sure there aren't others below the drupal root if lower levels exist in your repo. – Coder1 Apr 21 '17 at 01:34

1 Answers1

0

Have you actually added the imgix-php files after you commented the .gitignore file, using

git add /path/to/folder/* 

or

git add --all /path/to/folder 

?

Maaaatt
  • 429
  • 4
  • 14