Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15

Re: alias g to git in .gitconfig?

From: Rob Sanheim <hidden>
Date: 2016-06-15 22:45:26

Thanks, that did it.

On Thu, Oct 2, 2008 at 11:10 PM, Shawn O. Pearce [off-list ref] wrote:
Rob Sanheim [off-list ref] wrote:
quoted
This is pretty trivial, but I'm a lazy typist.

Is it possible to alias 'g' to git via git config, instead of via
bash?  If I do a plain bash alias then none of the nice autocompletion
from git-contrib work with 'g'.
No, you'll need to alias 'g' to git in bash, and then if you still
want completion you'll need to also register the compgen to call
_git completion routine.  Its two lines:

       alias g=git
       complete -o default -o nospace -F _git g

--
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help