Sunday, August 2, 2015

Turn on GIT Autocompletion in Mac OSX



if [ -f ~/.git-completion.bash ]; then
   source ~/.git-completion.bash
fi
  1. Open up terminal and navigate to your root/home directory: cd ~
  2. Download git-completion.bash from github.com via the terminal by typing the following:          curl -Lo .git-completion.bash https://github.com/git/git/raw/master/contrib/completion/git-completion.bash 
  3. Put the following in you .bashrc or .bash_profile in you root/home directory:  
    if [ -f ~/.git-completion.bash ]; then
       source ~/.git-completion.bash
    fi
  4. Restart Terminal
  5. Navigate to you git repository
  6. Type "git a"+tab and you should see "git add" or try "git h"+tab and you should see "git help"

Links
Bash Scripting: How to
Bash Beginners Guide 
Advanced Bash Scripting

No comments: