# should git command and git-command be equivalent?

6 messages from 2007-10-16 to 2007-10-16. Participants: franky, Matthieu Moy, David Symonds.
Thread: https://gitlist.dev/t/10298

## franky, 2007-10-16 03:22

Subject: should git command and git-command be equivalent?
Message-ID: <20071016032240.AD2FD7E80@mail.kooxoo.com>
URL: https://gitlist.dev/e/20071016032240.AD2FD7E80%40mail.kooxoo.com

```
	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. So, should git init and git-init be equivalent? If not, I
think the document should be supplemented to clarify this.

 franky

```

## Matthieu Moy, 2007-10-16 07:48

Subject: Re: should git command and git-command be equivalent?
Message-ID: <vpqprzfsdo3.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqprzfsdo3.fsf%40bauges.imag.fr
In-Reply-To: <20071016032240.AD2FD7E80@mail.kooxoo.com>

```
"franky" <yinping@kooxoo.com> writes:

> 	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

```

## franky, 2007-10-16 08:47

Subject: RE: should git command and git-command be equivalent?
Message-ID: <20071016084800.270917E6F@mail.kooxoo.com>
URL: https://gitlist.dev/e/20071016084800.270917E6F%40mail.kooxoo.com
In-Reply-To: <vpqprzfsdo3.fsf@bauges.imag.fr>

```
> 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).
I try "git st", but it complains "git: 'st' is not a git-command".
Instead, I use gt-beginning abbreviation for some command frequently used
such as gtci->git-commit, gtco-->git-checkout, gtst-->git-status,
gtdi->git-diff, gtinit->git-init

So it will be wonderful if I can use "gtinit --bare"

> --
> Matthieu
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

```

## Matthieu Moy, 2007-10-16 08:55

Subject: Re: should git command and git-command be equivalent?
Message-ID: <vpqk5pnmoah.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqk5pnmoah.fsf%40bauges.imag.fr
In-Reply-To: <20071016084800.270917E6F@mail.kooxoo.com>

```
"franky" <yinping@kooxoo.com> writes:

>> 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).
> I try "git st", but it complains "git: 'st' is not a git-command".

Sure, I'm talking about aliases, so what I meant is that I had

[alias]
	st = status

in ~/.gitconfig.

> Instead, I use gt-beginning abbreviation for some command frequently used
> such as gtci->git-commit, gtco-->git-checkout, gtst-->git-status,
> gtdi->git-diff, gtinit->git-init
>
> So it will be wonderful if I can use "gtinit --bare"

You can't without defining gtinit as a simple-but-not-totally-trivial
wrapper script.

But you can define an alias to init, to enable you to type

$ git --bare i

(that said, it could be a good idea for "git init" to accept --bare as
an option too).

-- 
Matthieu

```

## David Symonds, 2007-10-16 12:28

Subject: Re: should git command and git-command be equivalent?
Message-ID: <ee77f5c20710160528k520704d7pd3cf99dea1f83a77@mail.gmail.com>
URL: https://gitlist.dev/e/ee77f5c20710160528k520704d7pd3cf99dea1f83a77%40mail.gmail.com
In-Reply-To: <vpqk5pnmoah.fsf@bauges.imag.fr>

```
On 16/10/2007, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> "franky" <yinping@kooxoo.com> writes:
>
> >> 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).
> > I try "git st", but it complains "git: 'st' is not a git-command".
>
> Sure, I'm talking about aliases, so what I meant is that I had
>
> [alias]
>         st = status
>
> in ~/.gitconfig.

If you use the contrib/completion/git-completion.bash script, you can
type "git st<TAB>", and it'll complete it for you. Well, it did, until
git-stash came along and ruined it...

At any rate, the bash completion also completes things like branch
names, which can be immensely helpful.


Dave.

```

## Matthieu Moy, 2007-10-16 14:46

Subject: Re: should git command and git-command be equivalent?
Message-ID: <vpqhckri0ct.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqhckri0ct.fsf%40bauges.imag.fr
In-Reply-To: <ee77f5c20710160528k520704d7pd3cf99dea1f83a77@mail.gmail.com>

```
"David Symonds" <dsymonds@gmail.com> writes:

> If you use the contrib/completion/git-completion.bash script, you can
> type "git st<TAB>", and it'll complete it for you. Well, it did, until
> git-stash came along and ruined it...
>
> At any rate, the bash completion also completes things like branch
> names, which can be immensely helpful.

I don't use bash, but the zsh completion for git is also excellent.

But "git st" is still one less key to type than "git st<tab>" ;-).

-- 
Matthieu

```
