This article instructs how to apply a composer patch for Magento Commerce, Magento Commerce Cloud, and Magento Open Source.
We strongly recommend applying and testing the patch on the Staging/Integration environment, before applying it Production. We also recommend to have a recent backup before any manipulations.
How to apply a composer patch for Magento Commerce Cloud
- If you do not have a directory named
m2-hotfixesin the project root, please create one.
- Copy the
%patch_name%.composer.patchfile(s) to the
Add, commit, and push your code changes:
git add -A
git commit -m "Apply %patch_name%.composer.patch patch"
git push origin
For additional information about applying patches to Cloud projects, see Apply patches in Magento Developer Documentation.
How to apply a composer patch for Magento Commerce and Open Source
- Upload the patch to your Magento root directory.
- Run the following SSH command:
(If the above command does not work, try using
patch -p1 <
- For the changes to be reflected, refresh the cache in the Admin under System > Cache Management.