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

Re: Git not creating new directory when cloning

From
Jeff King <peff@peff.net>
Date
Jun 21, 2018, 17:45 UTC
Message-ID
<20180621174523.GB30249@sigill.intra.peff.net>
In-Reply-To
<CAKepmagD1VgRx+79rS9Swe8OL8SOwvRn6Yn-u_FCUy-OCUMeFQ@mail.gmail.com>
On Thu, Jun 21, 2018 at 12:04:11PM -0400, Jack Adrian Zappa wrote:
Show 8 quoted lines
> Hi, I was trying to clone a repo into a non-existent directory. but it
> gave me a failure:
> 
> $  git clone  https://github.com/jelera/vim-javascript-syntax.git
> ~/.vim/bundle/vim-javascript-syntax
> fatal: destination path
> '/home/username/.vim/bundle/vim-javascript-syntax' already exists and
> is not an empty directory.

That exact command works just fine for me. Are you absolutely sure that the directory did not exist?

Which version of Git are you using?
Show 8 quoted lines
> > The name of a new directory to clone into. The "humanish" part of
> > the source repository is used if no directory is explicitly given
> > (repo for /path/to/repo.git and foo for host.xz:foo/.git). Cloning
> > into an existing directory is only allowed if the directory is
> > empty.
> 
> Which to me, implies that the directory doesn't have to exist prior to
> cloning.  So is this a bug or a misunderstanding?
Correct, in general it should _not_ exist.
-Peff
Previous: Jack Adrian Zappa
Message 2 of 2 in “Git not creating new directory when cloning”
  1. Jack Adrian ZappaJun 21, 2018
  2. Jeff KingJun 21, 2018

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.