devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

app/etc/config.php tracking in VCS - docs conflict with links to .gitignore

Open df2k2 opened this issue 4 years ago • 3 comments

Track app/etc/config.php or not?

Topic Link

https://devdocs.magento.com/guides/v2.4/config-guide/prod/config-reference-gitignore.html

Description

The references to .gitignore found here: https://devdocs.magento.com/guides/v2.4/config-guide/prod/config-reference-gitignore.html and https://devdocs.magento.com/guides/v2.3/config-guide/prod/config-reference-gitignore.html are:

  • https://raw.githubusercontent.com/magento/magento2/2.4/.gitignore
  • https://raw.githubusercontent.com/magento/magento2/2.3/.gitignore

Which contain a reference to ignore app/etc/config.php : https://github.com/magento/magento2/blob/2.4-develop/.gitignore#L18

However, there are several statements throughout devdocs that would lead to an assumption that this app/etc/config.php file would not be set for ignore by VCS in .gitignore for 2.3 and 2.4 CE:

Reference 1: https://devdocs.magento.com/guides/v2.4/config-guide/deployment/pipeline/production-system.html

  • Make sure all of the following are included in source control:
    • app/etc/config.php

Reference 2: https://devdocs.magento.com/guides/v2.4/config-guide/deployment/pipeline/example/shared-configuration.html

Generate the shared configuration file, app/etc/config.php, in your development system and transfer it using source control to your build system as discussed in this section

Reference 3: https://devdocs.magento.com/guides/v2.4/config-guide/deployment/pipeline/technical-details.html

Manage the shared configuration The shared configuration is stored in app/etc/config.php, which should be in source control.

Reference 4: https://devdocs.magento.com/guides/v2.4/config-guide/prod/config-reference-most.html

The magento app:config:dump command writes these values to the shared configuration file, app/etc/config.php, which should be in source control.

Possible solutions

One of:

  • make it clear that app/etc/config.php needs to be explicitly added to VCS tracking
  • Remove the line ignoring app/etc/config.php from the .gitignore file,

Additional information

df2k2 avatar Oct 14 '21 05:10 df2k2

Hi @df2k2. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Oct 14 '21 05:10 m2-assistant[bot]

It was reported on the magento2 repo to remove the config.php file again from the .gitignore file, but no idea if something will be done with it, the issue has been open for quite a while now and is a bit messy (the messy part is probably my fault 😛)

hostep avatar Oct 20 '21 13:10 hostep

@jfrontain can you take a look?

erikmarr avatar Oct 28 '21 14:10 erikmarr