-
-
Save mokxter/33ba8cb353c2ef4c9edd41960f7e65d5 to your computer and use it in GitHub Desktop.
Mac OS X - Install Git Completion
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
| URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" | |
| PROFILE="$HOME/.profile" | |
| echo "Downloading git-completion..." | |
| if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
| echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
| fi | |
| SOURCE_LINE="source ~/.git-completion.bash" | |
| if [[ -f "$PROFILE" ]] && grep -q "$SOURCE_LINE" "$PROFILE"; then | |
| echo "Already added to bash profile." | |
| else | |
| echo "Adding to bash profile..." | |
| echo "$SOURCE_LINE" >> "$PROFILE" | |
| fi | |
| echo "Reloading bash profile..." | |
| source "$PROFILE" | |
| echo | |
| echo "Successfully installed." | |
| echo "Git auto-completion should be all set!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment