Skip to content

Instantly share code, notes, and snippets.

@7ochem
Last active March 13, 2016 20:28
Show Gist options
  • Save 7ochem/6086979 to your computer and use it in GitHub Desktop.
Save 7ochem/6086979 to your computer and use it in GitHub Desktop.
Useful git and Magento bash aliases
alias gitstashpullrebasepop="HAS_STASH=\$(git stash) && git pull --rebase; RETVAL=\$?; test \$RETVAL -eq 0 -a \"\$HAS_STASH\" != \"No local changes to save\" && git stash pop; test \$RETVAL -ne 0 -a \"\$HAS_STASH\" != \"No local changes to save\" && echo 'Stashed changes:' && git stash list"
alias cc='test -d htdocs && HTDOCS="htdocs/" || HTDOCS="";rm -vrf "$HTDOCS"{var/{cache,full_page_cache}/*,media/{js,css}/*.{js,css}}|sed "s/mage--[0-9a-f]/mage--?/;s/mage---[A-Za-z0-9_-]\+/mage---*/"|sort -r|uniq -c'
alias cc+='test -d htdocs && HTDOCS="htdocs/" || HTDOCS="";test -d /tmp/magento && TMP_MAGENTO="/tmp/magento" || TMP_MAGENTO="";rm -vrf "$HTDOCS"{var/{cache,full_page_cache,session,report}/*,media/{{js,css}/*.{js,css},catalog/product/cache/*}} "$TMP_MAGENTO"|sed "s/mage--[0-9a-f]/mage--?/;s/mage---[A-Za-z0-9_-]\+/mage---*/;s/sess_[0-9a-z]\+/sess_*/;s/report\/[0-9]\+/report\/*/;s/media\/\(css\|js\)\/.\+/media\/\1\/*/;s/\(catalog\/product\/cache\/\).*/\1*/"|sort -r|uniq -c'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment