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

Re: git clone NonExistentLocation

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 17, 2011, 12:39 UTC
Message-ID
<4D5D1715.5020707@drmicha.warpmail.net>
In-Reply-To
<4D5CE3E7.5030101@atlas-elektronik.com>
Stefan Naewe venit, vidit, dixit 17.02.2011 10:01:
Show 50 quoted lines
> Hi.
> 
> If I do:
> 
>  $ uname -a
> Linux as100897 2.6.26-2-686 #1 SMP Thu Nov 25 01:53:57 UTC 2010 i686 GNU/Linux
>  $ git version
> git version 1.7.4.1
>  $ ls -l NonExistentLocation
> ls: cannot access NonExistentLocation: No such file or directory
>  $ git clone NonExistentLocation
> Cloning into NonExistentLocation...
> warning: You appear to have cloned an empty repository.
>  $
> 
> I get a new (empty) git repository in 'NonExistentLocation':
> 
>  $ tree -a NonExistentLocation
> NonExistentLocation
> `-- .git
>     |-- HEAD
>     |-- branches
>     |-- config
>     |-- description
>     |-- hooks
>     |   |-- applypatch-msg.sample
>     |   |-- commit-msg.sample
>     |   |-- post-commit.sample
>     |   |-- post-receive.sample
>     |   |-- post-update.sample
>     |   |-- pre-applypatch.sample
>     |   |-- pre-commit.sample
>     |   |-- pre-rebase.sample
>     |   |-- prepare-commit-msg.sample
>     |   `-- update.sample
>     |-- info
>     |   `-- exclude
>     |-- objects
>     |   |-- info
>     |   `-- pack
>     `-- refs
>         |-- heads
>         `-- tags
> 
> 10 directories, 14 files
> 
> Is this the intended behaviour ?
> 
> Thanks,
>   Stefan

It is useful, and it even gives you a warning that it still might not be what you intended. Would be funny if it were accidental. Indeed, a git "log -S" on that warning reveals that it was introduced intentionally in

86ac751 (Allow cloning an empty repository, 2009-01-23)
Michael
Previous: Stefan NaeweNext: Stefan Naewe
Message 2 of 10 in “git clone NonExistentLocation”
  1. Stefan NaeweFeb 17, 2011
  2. Michael J GruberFeb 17, 2011
  3. Stefan NaeweFeb 17, 2011
  4. Michael J GruberFeb 17, 2011
  5. Sverre RabbelierFeb 17, 2011
  6. Michael J GruberFeb 17, 2011
  7. Jeff KingFeb 18, 2011
  8. Junio C HamanoFeb 18, 2011
  9. Jeff KingFeb 18, 2011
  10. Sverre RabbelierFeb 18, 2011

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.