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

Re: Redirect "git" subcommand to itself?

From
Aaron Schrab <aaron@schrab.com>
Date
May 29, 2015, 13:24 UTC
Message-ID
<20150529132453.GA1308@pug.qqx.org>
In-Reply-To
<87zj4n4w3t.fsf@gmail.com>
At 10:38 +0200 29 May 2015, Christian Neukirchen <chneukirchen@gmail.com> wrote:
Show 12 quoted lines
>Junio C Hamano <gitster@pobox.com> writes:
>
>>  * You can help yourself with something like this, I suppose:
>>
>>    [alias]
>> 	git = "!sh -c 'exec git \"$@\"' -"
>>
>>    but I personally feel that it is too ugly to live as part of our
>>    official suggestion, so please do not send a patch to add it as
>>    a built-in alias ;-).
>
>So I thought I was clever, but this didn't work:

I've done the same as the original poster a few times myself, so awhile ago I added the following to my .gitconfig file:

[alias]
    git         = "!f() { git $@; }; f"
And this has worked for me.
Previous: Christian NeukirchenNext: Junio C Hamano
Message 5 of 11 in “Redirect "git" subcommand to itself?”
  1. Stefan BellerMay 28, 2015
  2. Junio C HamanoMay 28, 2015
  3. Jeff KingMay 28, 2015
  4. Christian NeukirchenMay 29, 2015
  5. Aaron SchrabMay 29, 2015
  6. Junio C HamanoMay 29, 2015
  7. Stefan BellerMay 29, 2015
  8. Christian NeukirchenMay 29, 2015
  9. Junio C HamanoMay 29, 2015
  10. Konstantin KhomoutovMay 28, 2015
  11. Matthieu MoyMay 28, 2015

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.