5

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.

  • 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. – gertvdijk Jun 19 '13 at 18:50
  • yes it is installed - bash-completion is already the newest version – pcu Jun 19 '13 at 19:02
  • 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. :) – gertvdijk Jun 19 '13 at 19:05
  • @gertvdijk might be right. Try this: stackoverflow.com/a/18898614/394589 for your user – nush Oct 23 '13 at 13:58
  • @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 . – aravind.udayashankara Jan 26 '14 at 2:37
10

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

  • 1
    it works for Ubuntu 14.04 too. – logoff Oct 3 '14 at 7:22
  • Not worked for me – Himanshu dua Apr 11 '17 at 6:04
  • It works for Ubuntu 16.04 as well. The bash is indeed important. – Matthis Kohli May 28 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.