Skip to contentSkip to conversation

git clone git clone some://url

DISCUSSION Christoph Berg 5 participants 8 messages Nov 19, 2019 – Dec 5, 2019

lore
Share & tools
lore
#0 lore raw

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/

#1 lore raw
Quoted 7 lines · Christoph Berg

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.

#2 lore raw

Re: Junio C Hamano 2019-11-20 <[email protected]>

Quoted 12 lines
Quoted 7 lines · Christoph Berg

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

Quoted 7 lines
    $ 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

#4 lore raw
In reply to Junio C Hamano
Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Christoph Berg

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:

Quoted 7 lines
Quoted 2 lines
$ 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.

Quoted 5 lines

;-)

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

#3 lore raw
In reply to Christoph Berg
Quoted 21 lines · Christoph Berg

Re: Junio C Hamano 2019-11-20 <[email protected]>

Quoted 12 lines
Quoted 7 lines · Christoph Berg

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

Quoted 7 lines
    $ git git clone some://usr
    $ git git git diff

;-)

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

Quoted 7 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

Signature · 1 line
Danh
#5 lore raw
In reply to Denton Liu
Quoted 7 lines · Denton Liu
Quoted 4 lines

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.

#6 lore raw
In reply to Christoph Berg

Hi,

Quoted 7 lines · Christoph Berg

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

Quoted 2 lines

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