Protect passwords from being saved when storing generated PHP code in Git

I want to store the final generated PHP code of my projects in a git store (GitLab/GitHub), and I would prefer not to save the usernames/passwords, but currently the generated config.[env].php contains everything. can you implement something to store those secrets in a different way like “.env” files or something?

i can choose to generate a production config file just once and not commit it to the git repo, but the main config.php still contains the encryption_key and aes_encryption_key, which I prefer not to save in the git repo

You may enable Encrypt user name and password. However, don’t save your project file (with the encryption keys) and the generated scripts in the same repo.

I already encrypt the usernames and password, but as the application can decrypt them anybody who might get the encrypted ones can decrypt them too.

The idea is that in a future version separate the main secrets outside the config files.