Skip to content

Instantly share code, notes, and snippets.

@mokxter
Forked from johngibb/install-git-completion.sh
Created October 4, 2016 04:41
Show Gist options
  • Save mokxter/33ba8cb353c2ef4c9edd41960f7e65d5 to your computer and use it in GitHub Desktop.
Save mokxter/33ba8cb353c2ef4c9edd41960f7e65d5 to your computer and use it in GitHub Desktop.

Revisions

  1. @johngibb johngibb revised this gist Mar 3, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-git-completion.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-com

    PROFILE="$HOME/.profile"

    echo "Downloading git-completion for git version: $GIT_VERSION..."
    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
  2. @johngibb johngibb revised this gist Mar 3, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions install-git-completion.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    GIT_VERSION=`git --version | awk '{print $3}'`
    URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
    URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"


    PROFILE="$HOME/.profile"
  3. @johngibb johngibb revised this gist Aug 17, 2011. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install-git-completion.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    GIT_VERSION=`git --version | awk '{print $3}'`
    URL="https://github.com/git/git/raw/v$GIT_VERSION/contrib/completion/git-completion.bash"
    URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"


    PROFILE="$HOME/.profile"

  4. @johngibb johngibb created this gist May 14, 2011.
    26 changes: 26 additions & 0 deletions install-git-completion.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    GIT_VERSION=`git --version | awk '{print $3}'`
    URL="https://github.com/git/git/raw/v$GIT_VERSION/contrib/completion/git-completion.bash"

    PROFILE="$HOME/.profile"

    echo "Downloading git-completion for git version: $GIT_VERSION..."
    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!"