Bash completion and git prompt

Recently I discovered that the virtual server I was working on did not give me the usual bash completion I’m so used to on my Kubuntu workstations. Working on git repositories and upgrading web applications made this to an itch I just had to scratch.

After a bit of searching it appeared that I was missing a file: /etc/bash_completion. Next I discovered that there is a /etc/bash_completion.d/ directory and under this a file named ‘git’. I copied the bash_completion file from my workstation and followed the instruction in /etc/bash_completion.d/git and suddenly I had bash completion and a prompt that gave me branch name and the status of the git repository I was currently in.

Just to give you a hint, here is the comment from the /etc/bash_completion.d/git file: