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

Re: should git command and git-command be equivalent?

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Oct 16, 2007, 07:48 UTC
Message-ID
<vpqprzfsdo3.fsf@bauges.imag.fr>
In-Reply-To
<20071016032240.AD2FD7E80@mail.kooxoo.com>
"franky" <yinping@kooxoo.com> writes:
Show 6 quoted lines
> 	I use git-init frequently and it confuses me for a long time that I
> can't init a bare repository. 
> 	I just found I can do that by "git -bare init". However, I get used
> to "git-init" and I always tried "git-init -bare" (of course failed)
> 	And I thought git-init and "git init" were always the same as most
> newbies of git.

AFAIK, git-init and "git init" are equivalent, but as you noticed already, the advantage of "git init" is that you can pass options to the git command, not only to the "init" subcommand.

Also, you can use aliases (for example, I type "git st" to do "git status") with "git whatever", but not with "git-whatever" (unless you define the alias in your shell).

The git-whatever syntax is more or less deprecated, although I guess it will stay forever at least for compatibility.

-- 
Matthieu
Previous: frankyNext: franky
Message 2 of 6 in “should git command and git-command be equivalent?”
  1. frankyOct 16, 2007
  2. Matthieu MoyOct 16, 2007
  3. frankyOct 16, 2007
  4. Matthieu MoyOct 16, 2007
  5. David SymondsOct 16, 2007
  6. Matthieu MoyOct 16, 2007

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.