Difference between revisions of "Git autocomplete"

From Dreamwidth Notes
Jump to: navigation, search
(Created page with "If you are using git on a dreamhack, you can set up the bash shell to autocomplete git commands and branch names. This is Very Useful. First, download the script: <pre>wget ...")
 
(added category)
 
Line 11: Line 11:
  
 
From the next time you log in, you should be able to press tab and have git commands and git branch names autocomplete on the command line. Shiny!
 
From the next time you log in, you should be able to press tab and have git commands and git branch names autocomplete on the command line. Shiny!
 +
 +
[[Category:Development]]
 +
[[Category:Git]]

Latest revision as of 08:29, 22 August 2012

If you are using git on a dreamhack, you can set up the bash shell to autocomplete git commands and branch names. This is Very Useful.

First, download the script:

wget https://raw.github.com/git/git/master/contrib/completion/git-completion.bash ~/bin/git-completion.sh

Then, set your shell to load this script. Edit the file .bashrc in your home directory,

nano ~/.bashrc

and add this command to the end of it:

source ~/bin/git-completion.sh

From the next time you log in, you should be able to press tab and have git commands and git branch names autocomplete on the command line. Shiny!