Home DDEV Bash Aliases
Post
Cancel

DDEV Bash Aliases

Do you have your aliases set up in your DDEV project? You should! Here’s a quick guide to setting up some useful aliases for your DDEV projects.

Create the file

In your DDEV project, in the .ddev directory, create this file: .ddev/homeadditions/.bash_aliases or .ddev/homeadditions/.zsh_aliases if you’re using zsh.

Add your aliases

Here are some of my favorites:

1
2
3
4
5
6
alias dance="bin/magento setup:upgrade && bin/magento setup:di:compile && bin/magento setup:static-content:deploy -f"
alias dance-fast="bin/magento setup:upgrade --keep-generated && bin/magento setup:static-content:deploy -f"
alias dance-front="rm -rf pub/static/frontend/* var/view_preprocessed/* && bin/magento c:f && bin/magento setup:upgrade --keep-generated && bin/magento setup:static-content:deploy -f"
alias nuke="rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* pub/static/* generated/*"
alias disable-caches="bin/magento cache:disable block_html full_page layout"
alias enable-caches="bin/magento cache:enable block_html full_page layout"

Full documentation here: https://ddev.readthedocs.io/en/latest/users/extend/in-container-configuration/

Restart your project

After you’ve added your aliases, you’ll need to restart your project to see them take effect.

1
ddev restart

That is all

That’s it!

Once your project is restarted, you can use these aliases inside a ddev ssh session.

If you’re a Magento dev, you’ll likely find these useful. If you’re not, you can still use the concept to create your own aliases for your projects.

This post is licensed under CC BY 4.0 by the author.

Breaking changes from n8n v1.0+

Disabling 2FA in local Magento 2 development

Comments powered by Disqus.