1

in my ~/.bashrc, for git I have this alias

alias g='git'

how I can use the autocompletion of git with my alias g ?

1 Answer 1

3

Add the following line to your .bashrc file:

complete -F XXX g

where XXX should be replaced by the value following -F in the output of the following command:

complete -p git

(It is likely, but not guaranteed, that this will be _git.)

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, I add this line complete -o bashdefault -o default -o nospace -F _git g
Actually only complete -F _git g would be needed. Not sure if et matters though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.