I have implemented a custom git command by writing a shell script located in /usr/local/bin
. It works fine, but I would like the script to autocomplete branches in the command line, just like git checkout [TAB][TAB]
. How could this be done?
EDIT:
Just adding some context: git allows you to very easily add your own commands by creating a script git-$subcommandName
. In my case here git-install
, the script facilitates checking out a branch, building, packaging, and installing the source code.