Git workflow for Composer-based projects I would like to install/manage Drupal with Git, Drush, and configuration synchronization.

Should I add core/ and vendor/ into the .gitignore so that instead of pushing/pulling core I simply update core on prod/dev and synchronize configuration only?

This way I could potentially manage a Drupal site with few repositories:


Repository for configurations
Repository for a custom theme
Repository for custom modules


When updating a module, this would be my workflow.

On development


git pull
drush up
drush config-export to-prod
git push


On production


git pull
drush up
drush config-import to-prod


I ask because it doesn't seem to make sense that I have to push/pull all of Drupal 8 with every update.
If your goal is to minimize the size of your repository, then you should use Composer, following the pattern described in the project drupal-composer/drupal-project.

One possible workflow would then be:

On dev:


git pull
composer install
drush config-export
git add / commit / push


On stage:


git pull
composer install
drush config-import


On live:


rsync from stage to live
drush config-import


The workflow you propose will not work. The command drush pm-update will not do anything if Drupal is already at the most recent version. drush pm-download is not a good alternative either, as it will overwrite portions of your code base. You could potentially repair this with a git reset --hard or some similar trick, but that would not be very clean.

If you do not wish to use Composer, your best option is to simply commit the core and vendor directories.