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<
First, look up the original completion command. Example:
$ complete | grep git
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main git
Now add these to your startup script (e.g. ~/.bashrc):
# copy the original statement, but replace the last command (git) with your alias (g)
complete -o bashdefault -o default -o nospace -F __git_wrap__git_main g
# load dynamically loaded completion functions (may not be required)
_completion_loader git
The _completion_loader line may not be required. But for some situations, the completion function is only loaded dynamically after you type the command and press TAB the first time. So if you haven't used the original command, and try the alias + TAB, you may get an error like "bash: completion: function '_docker' not found".