I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (git status, git checkout etc.) complete themselves when hitting Tab? Like other CLI commands do.

P.S. I'm using Arch Linux, if that anyhow matters.

  • What shell are you using? Bash? – nsg Aug 13 '12 at 9:13
  • Yes, Bash. Sorry for not mentioning that. – daGrevis Aug 13 '12 at 9:29
  • You have this file /etc/bash_completion.d/git or not, it belongs to core/git – daisy Aug 13 '12 at 11:37
up vote 15 down vote accepted

Add source /usr/share/git/completion/git-completion.bash to your ~/.bashrc.

References

  1. Arch Linux Wiki

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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