git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: alias g to git in .gitconfig?

From
Rob Sanheim <rsanheim@gmail.com>
Date
Oct 3, 2008, 15:25 UTC
Message-ID
<fc113d400810030825l75f9451dwc4cbf68807be0b5b@mail.gmail.com>
In-Reply-To
<20081003031014.GA24367@spearce.org>
Thanks, that did it.
On Thu, Oct 2, 2008 at 11:10 PM, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 17 quoted lines
> Rob Sanheim <rsanheim@gmail.com> wrote:
>> 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.
>
Previous: Shawn O. PearceNext: Thomas Rast
Message 3 of 6 in “alias g to git in .gitconfig?”
  1. Rob SanheimOct 3, 2008
  2. Shawn O. PearceOct 3, 2008
  3. Rob SanheimOct 3, 2008
  4. bash completion: alias 'g' to 'git' with completionThomas Rast, Oct 3, 2008
  5. bash: remove fetch, push, pull dashed form leftoversSZEDER Gábor, Oct 3, 2008
  6. Thomas RastOct 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.