Development with git branches/ gitflow and new modules I wonder if somebody found a solution for the following issue related to Drupal 8 development with Git branches:


You work on a new feature in a local feature branch
for that you activate a contributed module or you write a custom module. This maybe delivers an own entity type and therefore creates a table after installing
Meanwhile you need to fix a bug -> you change to a newly created bugfix branch which starts from the current dev branch
After checking out the bugfix branch you import the current configurations to have the current active configuration of the branch -> the module you installed in feature branch is not activated anymore, the files of this module do not exist in the current bugfix branch
You do your bugfixing and merge ths bugfix branch into develop branch.
you change to your feature branch. To bring your local Drupal project to the status of this branch again you will import the configurations again


And here it comes to an exception: the table already exists in your database. When doing a drush cim it stops every following processing and you need to restart drush cim to import any further configurations.

Who does work with different feature branches and found a solution during development process to deal with this kind of situation?
I always have a somewhat up-to-date DB dump from live/master available. When switching between feature branches I can drush sql-drop the DB, drush sql-cli &lt; live.sql and drush cim the branch config. If needed. When switching back into the develop or master branch I do the same steps again.

This means you routinely have to commit your feature's configs into its branch. Or to write really cool install.yml in a custom module and enable that after you switched back into the feature branch.

I guess we will have something automating this in half a year. But for now, it's perfectly fine. At least for me.