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

Re: git alias for options

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 17, 2017, 13:15 UTC
Message-ID
<e6b3b3fa-2993-2850-a682-c58312a8385c@drmicha.warpmail.net>
In-Reply-To
<CAM_JFCz+9mxp37BTT7XPJ0fMd41DdbAxnvQF7id9msH+SDe6_Q@mail.gmail.com>
hIpPy venit, vidit, dixit 17.02.2017 09:23:
Show 6 quoted lines
> Git has aliases for git commands. Is there a (an inbuilt) way to alias
> options? If not, what is the reason?
> 
> Thanks,
> hippy
> 
You can setup an alias for "command with options", for example:

git help s `git s' is aliased to `status -s -b -uno .'

As you see here, this can include non-option arguments such as the pathsepc '.'.

You cannot alias options independent of the command, though.
Michael
Previous: hIpPyNext: Ævar Arnfjörð Bjarmason
Message 2 of 9 in “git alias for options”
  1. hIpPyFeb 17, 2017
  2. Michael J GruberFeb 17, 2017
  3. Ævar Arnfjörð BjarmasonFeb 17, 2017
  4. Jeff KingFeb 17, 2017
  5. Ævar Arnfjörð BjarmasonFeb 17, 2017
  6. Jeff KingFeb 17, 2017
  7. Junio C HamanoFeb 17, 2017
  8. hIpPyFeb 17, 2017
  9. Jeff KingFeb 18, 2017

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.