I’m working on a project at the moment with the same problem.

I think the easiest solution is just to omit the wp_config table when exporting your SQL locally.

Or just copy the SQL into an update file in your repository. Then you can just run the file and execute the query.