2

I'm new to GIT and Applying Security Patches. What is the most efficient way to apply a Magento Security Patch using GIT? Do I just push it to Magento's root directory and then use SSH to install it? I'm a bit confused because because looking at commit history it looks like other developers pushed difference files? Lastly, I have a total of 4 security patches to install. Should I commit them individually? or as a group? Thank you for any clarification.

asked Aug 5, 2015 at 16:48

2 Answers 2

2

Ideally you would create a new branch for your patch, then apply the patch and merge the branch for production when you are ready to deploy.

It would be best to put the patch number in your commit so other can see it (Find it later if needed)

As for deployment the rudimentary way would be to logon to your server via ssh and do a git pull origin master... of course this is not the best practice. But it will work.

I would put each patch separately in a new feature branch and then merge them to master.

answered Aug 5, 2015 at 21:23
5
  • 1
    Also you don't actually need to commit the patch file. Just run it locally and commit the changes it makes. Commented Aug 5, 2015 at 21:47
  • @andrewkett if you don't commit your patch how does everyone else get that version of Magento you are working on? (say you have a team of 10 developers?) Commented Aug 6, 2015 at 13:01
  • 1
    sorry not sure I understand your question. Just to be clear, I am not saying you don't need to commit anything, just the script used to apply the patch :) the applied.patches.list file should tell you everything you need about the patch you just applied Commented Aug 6, 2015 at 14:15
  • @andrewkett I think I was getting the "Patch File" confused with the all the files that patch updates :) Commented Aug 7, 2015 at 20:05
  • Should I also include all untracked files when installing patches? In this instance I am referring to: downloader/Maged/.htacces & downloader/lib/.htaccess Commented Aug 9, 2015 at 14:24
0

You should clone the repo locally, apply the patches, and push the changes.

For example

git clone https://repo.example.com/company/magento ~/magento
cd ~/magento
mv ~/Downloads/PATCH_SUPEE* ./
bash PATCH_SUPEE-1.sh
git add .
git commit -m 'Applied patch SUPEE-1'
# Repeat line 4-6 for patch 2, 3, etc
git push origin master

Then deploy/pull the updated branch to your server.

answered Aug 5, 2015 at 23:52

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.