If you are hacking the contributed modules, then you are doing it wrong.Here are the strategies that you can take to maintain the patches in the project.It depends on the structure of the project.
In my last blog post, I outlined the best practices to manage the configuration management for the site. If you have read the previous post and wanted to follow the same on your site, this post will show you how to do Switching from file system configuration management to features on existing drupal site easily.
There's not any hard and fast way to change the configuration management for an existing Drupal site. Here are the steps in brief involved in to do the following:
There are several ways to manage the drupal site configuration in Drupal 8 either by keeping it in the database or managing it at from the file system or managing with features.
I have launched couple of sites with the combination of the following best practices with managing features and configuration in file system
In one of my recent client project, we had the requirement to move to lightning profile from custom installation profile, so that they would be able to use the lightning features OOTB. During the POC we found different approaches of using/consuming the lightning features, but we planned to use the lightning extend approach.
In Drupal7, there was pretty easy way to do was to update the install_profile variable