Sunday, August 21, 2011

Bash shell auto-completion for Git

Nice Git tweak taken from http://progit.org/book/
Quote:


If you use the Bash shell, Git comes with a nice auto-completion script you can enable. Download the Git source code, and look in the contrib/completion directory; there should be a file called git-completion.bash. Copy this file to your home directory, and add this to your .bashrc file:
source ~/.git-completion.bash
If you want to set up Git to automatically have Bash shell completion for all users, copy this script to the/opt/local/etc/bash_completion.d directory on Mac systems or to the /etc/bash_completion.d/directory on Linux systems. This is a directory of scripts that Bash will automatically load to provide shell completions.


No comments:

Post a Comment