Case in point:
I\'m a on mac with bash v3.2.17, I\'m using git installed via macports with the bash_completion variant.
When I type git checkout m<
You just have to find the complete command and duplicate the line having the alias name instead.
I have alias d-m="docker-machine". In words, d-m shall be the alias for docker-machine.
So on Mac (via brew), the completion files are in cd `brew --prefix`/etc/bash_completion.d/.
For my case I edited the file called docker-machine.
All the way at the bottom there was:
complete -F _docker_machine docker-machine
So I just added another line, with my alias:
complete -F _docker_machine docker-machine
complete -F _docker_machine d-m