I am using the following .bashrc file. The tab completion works fine. However. The second piece of code the #show branch is not being so nice. When I first set it up and sourced it it worked fine. My terminal window it was is at the home location would look something like this [~]$ and when its in a branch something like [direcorty (master)]$ However when I opened a new tab window of terminal it goes back to something like Anders-imac:~ anderskitson$ How do I get the Show branch in status line to stay.
#Git tab completion
source ~/git-completion.bash
# Show branch in status line
PS1='[\W$(__git_ps1 " (%s)")]\$ '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
The reason it’s not staying is likely because your terminal is using
.bash_profilerather than your.bashrc.I would create a link to your
.bashrcfile so that all new terminal windows will use that code from a single.bashrcfile:mv= move, this will backup your current .bash_profile in case you have something important in there you want to keep.ln -s= create a symbolic link from .bashrc to .bash_profile.