Created
October 12, 2009 08:30
-
-
Save zerodogg/208248 to your computer and use it in GitHub Desktop.
Dynamically load git bash completion
This file contains 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
# Dynamically load git bash completion | |
function __LoadGitBashCompl () | |
{ | |
# Remove the existing placeholder completion | |
complete -r git | |
# Load the full completion if it exists | |
if [ -e "/etc/bash_completion.d/git" ]; then | |
source "/etc/bash_completion.d/git" | |
_git "$@" | |
else | |
# Fall back to some basic completion if the full one does not exist | |
complete -W "add blame checkout commit diff help merge mkdir move stat status branch push pull clean log rebase reset tag clone cherry-pick" -A file git | |
fi | |
} | |
# Calls __LoadGitBashCompl the first time git completion is accessed | |
complete -o default -o nospace -F __LoadGitBashCompl git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment