This topic is designed to help you decide whether to use Git or Composer to distribute custom code, with consideration for release management, code complexity, and dependency management.
These best practices are most suitable for migrations and implementations; less so for single module development.
It covers both global reference architecture (GRA) and single instance installations.
|Code managed primarily through Git||Code managed primarily through Composer|
|When to use for a single-instance setup||
|When to use for a multi-instance setup||
|Main code repository||All code resides in one single, or a few Git repositories||All code resides in the packages in a Composer repository
Each single Composer package is represented by a Git repository
|Code location||Development happens in the
||Development happens in the
|Core upgrade management||Adobe Commerce core is installed and upgraded using Composer, the result is committed in Git||Adobe Commerce core is installed and upgraded using Composer; the result is committed in Git|
|Third-party module management||Third-party modules are installed in
||All third-party modules are installed in the
|Releases||Releasing is characterized by
||Releasing is characterized by
|Number of Git repositories||Few||Many|
|Pull request complexity||Simple||Complex|
|Code review complexity||Simple||Simple|
|Dev/QA/UAT environment update complexity||Simple||Complex|
|Modules can automatically install external libraries|
|Flexibility in GRA composition|
|Module dependency management|| Only through
|| Full dependency management through
|Module versioning||You can define a version, but you cannot install a specific version||Full version support|
|Paid services needed||Git repository||Git repository, Private Packagist (± €600 per year)|
|Bitbucket integration with Jira possible|
|Changes to code instantly available for installation|
Combining Composer and
app/code for your modules
Result in having all the disadvantages of both code management styles combined in your project. It adds unnecessary complexity, instability, and lack of flexibility.
app/codeas there is nothing in place to stop that from happening.
app/codeto Composer (or conversely) is cumbersome, especially with ongoing development.
Satis Package Manager
Private Packagist costs ± €600 per year. This cost is for the whole GRA combined, not per brand. Don’t try to avoid these costs by using the free solution Satis. Satis does not automatically update your packages whenever you push commits to git. Also Satis has no built in authorization. You must maintain a web server to run Satis. You end up spending a multitude of the Private Packagist subscription fee maintaining Satis.
Start with Git, then move to Composer
Make the choice for a code management approach at the start of your project. Switching from Git to Composer or conversely, with ongoing development is cumbersome and could lead to code loss and or revision history loss.