How do I update the configuration of a module? I'm building a custom module in Drupal 8. It includes some YAML config files.
As I develop I need to change and add to the config, e.g. to add another field onto my custom entity.
At present the only way I've found to get Drupal to notice the changes is to uninstall the module and re-install it.
Is there a way to get Drupal to check that the config files provided by modules is the same as the active config, and if not, update the active config? How are module updates handled? In D7 hook_update_N would be used to add fields using PHP, but it looks like this should be handled by the CM in D8?
Things I've tried after updating the yml files in the module:

drush cr, config sync.

manually copying all the updated config files into sites/default/files/config_XXX/staging/ - but this gives this error &quot;The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.&quot;.

manually importing the files one by one using the config manager. This works, but obviously there must be a more automatic way.

[EDIT] manually use the config_update module to inspect changes and 'revert' to the module's config. Again, this is manual.


EDIT: From Managing configuration - do's and don'ts

DON'TS
Try to change the active configuration on your site by changing files in a module's config/install directory. This will NOT work because Drupal will only read from that directory when the module is installed.

...but changes there are going to happen, unless modules are bound to whatever config they needed in their first ever release, and may never ever update or add config.
Thanks in advance.
As mentioned in the original question, and follow-up comments, there are a variety of contrib modules and manual methods to accomplish this.

To do it automatically, or in a custom fashion, I think hook_update_N() is still probably the most viable option.

For instance, this is an example from the Head 2 Head to update system.site to set the default_langcode:

  $config_factory = \Drupal::configFactory();
  $langcode = $config_factory-&gt;get('system.site')-&gt;get('langcode');
  $config_factory-&gt;getEditable('system.site')-&gt;set('default_langcode', $langcode)-&gt;save();


You can also read in config (recommended only for adding new config, not necessarily updating or overriding config that may have been customized):

  $source = new FileStorage($path);
  /** @var \Drupal\Core\Config\StorageInterface $active_storage */
  $active_storage = \Drupal::service('config.storage');
  $active_storage-&gt;write($name, $source-&gt;read($name));


where $path is the absolute path to the my_config.foo.yml file.