You want autocompletion, colours and your current branch in your terminal? You can find hundreds of tutorials on the net, I will just tell you what to do on MacOS:
Add these lines to your .bash_profile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
export CLICOLOR=1 export LSCOLORS=GxFxCxDxBxegedabagaced export PATH=$PATH:/opt/local/bin # Set git autocompletion and PS1 integration if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then . /usr/local/git/contrib/completion/git-completion.bash fi if [ -f /usr/local/git/contrib/completion/git-prompt.sh ]; then . /usr/local/git/contrib/completion/git-prompt.sh fi GIT_PS1_SHOWDIRTYSTATE=true if [ -f /opt/local/etc/bash_completion ]; then . /opt/local/etc/bash_completion fi if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then . /opt/local/etc/profile.d/bash_completion.sh fi PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[36m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ ' |
This will enable autocompletion for git commands and branch names and also show your current branch. Note that in the last line, you can change colours if you’d like to be different.
You may need these two files in /usr/local/git/contrib/completion.
To enable fancy colours in your git command output, type:
1 |
git config --global color.ui auto |
or just some of these if you don’t want everything coloured:
1 2 3 4 |
git config --global color.branch auto git config --global color.diff auto git config --global color.interactive auto git config --global color.status auto |
Enjoy your all-new Terminal.