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

Re: default aliases (ci, di, st, co)

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jul 9, 2009, 08:50 UTC
Message-ID
<4A55AF45.4040700@drmicha.warpmail.net>
In-Reply-To
<4A55958E.1050401@op5.se>
Andreas Ericsson venit, vidit, dixit 09.07.2009 09:00:
Show 61 quoted lines
> Ondrej Certik wrote:
>> Hi,
>>
>> coming to git from mercurial and svn, here is the alias part of my .gitconfig:
>>
>> [alias]
>>     ci = commit
>>     di = diff --color-words
>>     st = status
>>     co = checkout
>>
>>
>> And all is fine until I share commands to checkout my branch (for
>> example) with other people, then basically I have to write those
>> commands in full (e.g. commit, checkout, ...), since I cannot assume
>> they have their .gitconfig setup the same way I do. Especially for
>> people who are new to git.
>>
>> What is the view on this in the git community?
> 
> 
> Personally I think "plain" aliases like you use above are evil.
> git is not svn or mercurial. If you use it like svn you'll be
> surprised sooner or later and your workflow will feel awkward or
> just plain wrong. hg and git are very similar, but the fact that
> hg assumed the svn shorthands implies to me that they've tried
> to retain a compatibility that does not, in fact, exist. DVCS
> systems are enormously different from centralized ones. Borrowing
> from centralized ones to a DVCS one feels utterly backwards.
> 
> 
>> Do most of you write
>>
>> git checkout -b branch ...
>>
>> (possibly with TAB completion) or do most of you write
>>
>> git co -b branch ...
>>
>> (like I do all the time, except when sharing my commands with other people)?
>>
> 
> I have no simple aliases for any of the commands. There's just no reason
> for them since tab completion works so well.
> 
> I do have one alias, which is "wsfix". It fixes whitespace fsckups I've
> added to the index but not yet committed to the worktree. It's not a
> particularly complex one, but not exactly simple either.
> 
> 
>> Could in principle those aliases be even made default by git? Or is
>> this not a good idea.
>>
> 
> I see no reason to add default aliases. It will make a mess of things
> when trying to explain workflows to people who have older versions of
> git where those default aliases aren't available. It'll add complexity
> to explanations, which is never a good thing.
> 
> If I have a vote, I vote no.
> 
Adding my no-vote to that, too.

Aliases are great, but default aliases are a problem. We saw this when we introduced "git stage", and I don't think we're happy in retrorespect.

Having said that, collecting useful aliases (e.g. one, who, ...) in contrib/ or in the wiki would be helpful.

Michael
Previous: Andreas EricssonNext: Graeme Geldenhuys
Message 10 of 19 in “default aliases (ci, di, st, co)”
  1. Ondrej CertikJul 8, 2009
  2. Jakub NarebskiJul 9, 2009
  3. Graeme GeldenhuysJul 9, 2009
  4. Junio C HamanoJul 9, 2009
  5. Paolo BonziniJul 9, 2009
  6. Jeff KingJul 13, 2009
  7. Jeff KingJul 13, 2009
  8. Paolo BonziniJul 13, 2009
  9. Andreas EricssonJul 9, 2009
  10. Michael J GruberJul 9, 2009
  11. Graeme GeldenhuysJul 9, 2009
  12. Jakub NarebskiJul 9, 2009
  13. Michael J GruberJul 9, 2009
  14. Luciano Miguel Ferreira RochaJul 9, 2009
  15. Ondrej CertikJul 12, 2009
  16. Graeme GeldenhuysJul 9, 2009
  17. Matthieu MoyJul 9, 2009
  18. wsfix aliasAndreas Ericsson, Jul 9, 2009
  19. Larry D'AnnaJul 9, 2009

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.