# git clone git clone some://url

8 messages from 2019-11-19 to 2019-12-05. Participants: Christoph Berg, Junio C Hamano, Denton Liu, Danh Doan, Jonathan Nieder.
Thread: https://gitlist.dev/t/52293

## Christoph Berg, 2019-11-19 14:15

Subject: git clone git clone some://url
Message-ID: <20191119141537.GD18924@msg.df7cb.de>
URL: https://gitlist.dev/e/20191119141537.GD18924%40msg.df7cb.de

```
On some git hosting sites [*], if you copy the repository URL, you'll
actually get "git clone some://url" in the cut buffer. When you then
proceed to do "git clone <paste>" in the next terminal window, the
command executed is actually this:

$ git clone git clone some://url
fatal: Too many arguments.

As silly as the idea might sound, could the clone command possibly
ignore these very specific extra arguments, and just proceed? This has
happened countless times to me, and when I mentioned the idea on
#debian-devel, there were others who had the same problem.

Thanks,
Christoph

[*] hello sourceforge! example:
    https://sourceforge.net/p/wsjt/wsjtx/ci/master/tree/

```

## Junio C Hamano, 2019-11-20 03:50

Subject: Re: git clone git clone some://url
Message-ID: <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqimnfcikf.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20191119141537.GD18924@msg.df7cb.de>

```
Christoph Berg <myon@debian.org> writes:

> On some git hosting sites [*], if you copy the repository URL, you'll
> actually get "git clone some://url" in the cut buffer. When you then
> proceed to do "git clone <paste>" in the next terminal window, the
> command executed is actually this:
>
> $ git clone git clone some://url
> fatal: Too many arguments.

Or

    $ git git clone some://usr
    $ git git git diff

;-)

I seriously doubt "git" should do anything funky when fed such
command lines.


```

## Christoph Berg, 2019-11-20 06:41

Subject: Re: git clone git clone some://url
Message-ID: <20191120064157.GA22081@msg.df7cb.de>
URL: https://gitlist.dev/e/20191120064157.GA22081%40msg.df7cb.de
In-Reply-To: <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>

```
Re: Junio C Hamano 2019-11-20 <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>
> Christoph Berg <myon@debian.org> writes:
> 
> > On some git hosting sites [*], if you copy the repository URL, you'll
> > actually get "git clone some://url" in the cut buffer. When you then
> > proceed to do "git clone <paste>" in the next terminal window, the
> > command executed is actually this:
> >
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> Or
> 
>     $ git git clone some://usr
>     $ git git git diff
> 
> ;-)
> 
> I seriously doubt "git" should do anything funky when fed such
> command lines.

"git git git" is obviously silly. The problem is really just about
this single issue:

1. go to some website, copy the git url
2. type "git clone" in the terminal
3. paste the url, hit enter
4. be annoyed when you ended up with "git clone git clone url://"

Christoph

```

## Denton Liu, 2019-11-20 18:07

Subject: Re: git clone git clone some://url
Message-ID: <20191120180709.GA63368@generichostname>
URL: https://gitlist.dev/e/20191120180709.GA63368%40generichostname
In-Reply-To: <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>

```
On Wed, Nov 20, 2019 at 12:50:24PM +0900, Junio C Hamano wrote:
> Christoph Berg <myon@debian.org> writes:
> 
> > On some git hosting sites [*], if you copy the repository URL, you'll
> > actually get "git clone some://url" in the cut buffer. When you then
> > proceed to do "git clone <paste>" in the next terminal window, the
> > command executed is actually this:
> >
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> Or
> 
>     $ git git clone some://usr
>     $ git git git diff

That's why I have `git config alias.git !git` set. It's saved me seconds
of my life from having to retype these lines. ;)

Unfortunately, I don't think we can take a similar approach for the
`git clone git clone ...` case.

> ;-)
> 
> I seriously doubt "git" should do anything funky when fed such
> command lines.
> 

```

## Danh Doan, 2019-11-21 13:49

Subject: Re: git clone git clone some://url
Message-ID: <20191121134928.GA1018@danh.dev>
URL: https://gitlist.dev/e/20191121134928.GA1018%40danh.dev
In-Reply-To: <20191120064157.GA22081@msg.df7cb.de>

```
On 2019-11-20 07:41:58+0100, Christoph Berg <myon@debian.org> wrote:
> Re: Junio C Hamano 2019-11-20 <xmqqimnfcikf.fsf@gitster-ct.c.googlers.com>
> > Christoph Berg <myon@debian.org> writes:
> > 
> > > On some git hosting sites [*], if you copy the repository URL, you'll
> > > actually get "git clone some://url" in the cut buffer. When you then
> > > proceed to do "git clone <paste>" in the next terminal window, the
> > > command executed is actually this:
> > >
> > > $ git clone git clone some://url
> > > fatal: Too many arguments.
> > 
> > Or
> > 
> >     $ git git clone some://usr
> >     $ git git git diff
> > 
> > ;-)
> > 
> > I seriously doubt "git" should do anything funky when fed such
> > command lines.
> 
> "git git git" is obviously silly. The problem is really just about
> this single issue:
> 
> 1. go to some website, copy the git url
> 2. type "git clone" in the terminal
> 3. paste the url, hit enter
> 4. be annoyed when you ended up with "git clone git clone url://"

Seriously, people should stop pasting random command from internet
without reading.

Someone had written about paste-hijacking in the past.

c.f. https://news.ycombinator.com/item?id=10554679

-- 
Danh

```

## Junio C Hamano, 2019-11-22 05:44

Subject: Re: git clone git clone some://url
Message-ID: <xmqqy2w85utj.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqy2w85utj.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <20191120180709.GA63368@generichostname>

```
Denton Liu <liu.denton@gmail.com> writes:

>> Or
>> 
>>     $ git git clone some://usr
>>     $ git git git diff
>
> That's why I have `git config alias.git !git` set. It's saved me seconds
> of my life from having to retype these lines. ;)

;-)

Yes, it was the above hack of yours I had in mind when I sent my
reply.

```

## Jonathan Nieder, 2019-12-04 21:40

Subject: Re: git clone git clone some://url
Message-ID: <20191204214017.GA195537@google.com>
URL: https://gitlist.dev/e/20191204214017.GA195537%40google.com
In-Reply-To: <20191119141537.GD18924@msg.df7cb.de>

```
Hi,

Christoph Berg wrote:

> On some git hosting sites [*], if you copy the repository URL, you'll
> actually get "git clone some://url" in the cut buffer. When you then
> proceed to do "git clone <paste>" in the next terminal window, the
> command executed is actually this:
>
> $ git clone git clone some://url
> fatal: Too many arguments.

I feel your pain.  Is there an issue tracker post or support ticket
open for some of these hosting sites to make it do the intuitive thing
(just copy the URL) instead?

Thanks,
Jonathan

> [*] hello sourceforge! example:
>     https://sourceforge.net/p/wsjt/wsjtx/ci/master/tree/

```

## Christoph Berg, 2019-12-05 12:35

Subject: Re: git clone git clone some://url
Message-ID: <20191205123524.GA30724@msg.df7cb.de>
URL: https://gitlist.dev/e/20191205123524.GA30724%40msg.df7cb.de
In-Reply-To: <20191204214017.GA195537@google.com>

```
Re: Jonathan Nieder 2019-12-04 <20191204214017.GA195537@google.com>
> > $ git clone git clone some://url
> > fatal: Too many arguments.
> 
> I feel your pain.  Is there an issue tracker post or support ticket
> open for some of these hosting sites to make it do the intuitive thing
> (just copy the URL) instead?

I created one for sf.net now: https://sourceforge.net/p/forge/feature-requests/721/

Christoph

```
