Question

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

alias g='git'

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

Was it helpful?

Solution

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.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top