Last active
December 22, 2015 19:29
-
-
Save kbambz/6520086 to your computer and use it in GitHub Desktop.
Install Git and setup bash autocompletion on Mac OS X using Homebrew.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Ensure Homebrew is installed | |
| # | |
| which -s brew | |
| if [[ $? != 0 ]]; then | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| brew doctor | |
| else | |
| brew update | |
| fi | |
| # | |
| # Ensure Git is installed | |
| # | |
| which -s git || brew install git | |
| # | |
| # Setup bash autocompletion for Git | |
| # | |
| if [[ ! -f ~/.git-completion.bash ]]; then | |
| echo "$(curl -fsSL https://raw.github.com/git/git/master/contrib/completion/git-completion.bash)" > ~/.git-completion.bash | |
| fi | |
| grep ".git-completion.bash" ~/.bashrc > /dev/null || echo "source ~/.git-completion.bash" >> ~/.bashrc && . ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment