By default on OSX bash is missing a lot of the tab compltion.
First of you need to have brew installed run this command in terminal
command -v brew >/dev/null 2>&1 && echo "Brew is installed." || { echo >&2 "Brew is not installed."; }
if brew is not installed follow a brew install guide.
Install bash, the command below will check if bash is installed and if not, it will install it.
# Install bash
(brew list | grep -Fwx "bash" > /dev/null 2>&1 ) && echo "Bash is already installed" || { brew install bash; }
# Add bash to /etc/shells
(cat /etc/shells | grep -Fwx "$(brew --prefix bash)"/bin/bash > /dev/null 2>&1) || { echo "$(brew --prefix bash)"/bin/bash | sudo tee -a /etc/shells; }
# Change default shell
chsh -s "$(brew --prefix bash)"/bin/bash
(brew list | grep -Fwx "bash-completion@2" >/dev/null 2>&1) || { brew install bash-completion@2; }
if [ -f /usr/local/share/bash-completion/bash_completion ]; then
. /usr/local/share/bash-completion/bash_completion
fi
looks something like this: https://github.com/magicmonty/bash-git-prompt/raw/master/gitprompt.png
# Install bash-git-prompt
(brew list | grep -Fxw "bash-git-prompt" > /dev/null 2>&1) || { brew install bash-git-prompt; }
GIT_PROMPT_ONLY_IN_REPO=1
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi