I am building a drupal 8 site and I am keeping my code on git. I am using a copy of example.gitignore as my .gitignore which exclude vendor folder. I have been working on my sandbox, at some point I have update drupal core from version 8.1.1 to version 8.1.3 and push it to git.

I have created a new sandbox, pulled code from git and system throw few errors because vendor folder wasn't there so I run composer install. Even then, I still had errors. I run composer update and I had errors again.

What is the right procedure in order to keep drupal 8 on git and at the same time not having problem with vendor folder?

If you download drupal 8 from drupal.org it contains vendor folder, should I keep vendor folder on git?

Thanks in advance.

  • 1
    I think storing vendor is a subjective opinion. On the one hand, it is a lot of space, but may be more of a one-time cost for cloning. On the other, who knows if that code will still be there in 6 months (people remove code from github unfortunately). My opinion is that I don't like storing things that are already stored elsewhere so I have a build process (from a drush make file + composer.lock or only a composer.lock) that deploys to where it's necessary. That said, you should not be running into any errors just by doing a composer install after a git pull. What are the specific errors? – mradcliffe Jul 10 '16 at 4:56

I strongly recommend you (as a current best practice), to use Drupal8 Composer project

In this case, the root folder is going to contain "web" and "vendor" directories, so you will have to set your apache/nginix vhost for looking the index.php for one directory deeper.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.