Last active
April 17, 2018 09:17
-
-
Save prichodko/f713af53752738fd635fa510871bb9cc to your computer and use it in GitHub Desktop.
How to use git-completion.bash for custom commands (e.g. git-friendly)
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
if type __git_complete &> /dev/null; then | |
_branch () { | |
delete="${words[1]}" | |
if [ "$delete" == "-d" ] || [ "$delete" == "-D" ]; then | |
_git_branch | |
else | |
_git_checkout | |
fi | |
} | |
__git_complete branch _branch | |
__git_complete merge _git_merge | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment