Setting up Git for Ubuntu with autocompletion

If you ever used any Linux distribution, you are most likely familiar with the default Bash completion functionality. You start typing a command, hit Tab, and the command gets automatically completed. If there are multiple commands that match what you typed so far, you can hit Tab two times, and Bash displays a list of all possible completions. The same works for variables and filenames, but not for the many commands Git provides.