Skip to content

Instantly share code, notes, and snippets.

@fooman
Last active April 25, 2017 16:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fooman/b8f4ddbeadf4adebffd911f3411e3d70 to your computer and use it in GitHub Desktop.
Save fooman/b8f4ddbeadf4adebffd911f3411e3d70 to your computer and use it in GitHub Desktop.
useful commands handling Magento patches
# The patch contains binary data which makes most editors corrupt the file when saving
# use sed to remove lines - for example if you have deleted the downloader folder
sed -i '6573,6686 d' PATCH_SUPEE-8788_CE_1.7.0.2_v1-2016-10-11-06-36-18.sh
# Find the line numbers for removing
# First mentioned number until the second to last
sed -n '/diff --git downloader/,/diff --git/{=;p;}' PATCH_SUPEE-8788_CE_1.7.0.2_v1-2016-10-11-06-36-18.sh
# Check for frontend template changes
cat PATCH_SUPEE-8788_FILENAME.sh |grep 'diff --git app/design/frontend/base/default'
@sergeifilippov
Copy link

on unix based systems like macOS the commands needs to be slightly different:

sed -ie '163,7736 d' PATCH_SUPEE-8788_CE_1.7.0.2_v1-2016-10-11-06-36-18.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment