Created
September 18, 2012 17:51
-
-
Save efatsi/3744621 to your computer and use it in GitHub Desktop.
Git completion with aliases
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
######## git_completion.bash ######## (from Chris J. file suggestion) | |
complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ | |
|| complete -o default -o nospace -F _git git | |
## Just added this line below, it works | |
complete -o default -o nospace -F _git_checkout gch | |
######## /usr/local/etc/bash_completion.d/git_completion.bash ######## (from brew install bash-completion) | |
__git_complete () | |
{ | |
local wrapper="__git_wrap${2}" | |
eval "$wrapper () { __git_func_wrap $2 ; }" | |
complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \ | |
|| complete -o default -o nospace -F $wrapper $1 | |
## This does NOT work, error displayed below | |
complete -o bashdefault -o default -o nospace -F _git_checkout gch 2>/dev/null \ | |
|| complete -o default -o nospace -F _git_checkout gch | |
} | |
$ gch ma(tab) ... | |
$ gch ma-bash: [: 1: unary operator expected | |
-bash: [: 1: unary operator expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment