How to fix git autocomplete in Ubuntu 13.04

7,003

I had the same problem with Ubuntu 13.04

This is how I solved it

To get bash completion you need to reinstall git-core along with bash-completion package and then restart your bash shell

sudo apt-get install git-core bash-completion 

Once successfully installed , just run

bash

By doing so new commands gets initialized in auto completion and it will start working .

Hope this helps

Share:
7,003
pcu
Author by

pcu

Updated on September 18, 2022

Comments

  • pcu
    pcu over 1 year

    In previous version of Ubuntu 12.10 when using git from command line autocomplete of commands, branches, tags... worked. After installing fresh Ubuntu 13.04 and git it does not work. What to set up to make it work again?

    Edited


    Git is installed using apt-get install git. When I enter:

    git i
    

    and press Tab nothing happens. init is not completed.

    • gertvdijk
      gertvdijk almost 11 years
      Do you have the package bash-completion installed? If so, the package git should provide /etc/bash_completion.d/git which will aid in the bash completion. (Log out and log back in after installation to enable the environment adapt to the new files installed.) If this fixes your issue, then I'll write this as an answer.
    • pcu
      pcu almost 11 years
      yes it is installed - bash-completion is already the newest version
    • gertvdijk
      gertvdijk almost 11 years
      Okay, obvious things excluded then. Are you running as root or as a regular user account? Did you install git from the Ubuntu package (software centre or APT) or using another method? Does git ini+TAB get completed to git init? Please include all additional information in your question by editing it. This is a Q&A site, not a discussion forum, you see. :)
    • nush
      nush over 10 years
      @gertvdijk might be right. Try this: stackoverflow.com/a/18898614/394589 for your user
    • Aravind.HU
      Aravind.HU over 10 years
      @pcu Its really a common problem faced , I could some how solve it , and I have also posted the same , please check if this solves your problem .
  • Himanshu dua
    Himanshu dua about 7 years
    Not worked for me
  • Matthis Kohli
    Matthis Kohli almost 5 years
    It works for Ubuntu 16.04 as well. The bash is indeed important.