* Git not creating new directory when cloning
@ 2018-06-21 16:04 Jack Adrian Zappa
2018-06-21 17:45 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: Jack Adrian Zappa @ 2018-06-21 16:04 UTC (permalink / raw)
To: git-mailing-list
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.
(the command was taken from install procedure from
https://github.com/jelera/vim-javascript-syntax)
The directory "/home/username/.vim/bundle" already existed, but
"'/home/username/.vim/bundle/vim-javascript-syntax" did not. Upon
creating the "vim-javascript-syntax" sub-directory, the clone command
succeeded. From what I read from the docs
(https://git-scm.com/docs/git-clone):
> git clone [--template=<template_directory>]
> [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]
> [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]
> [--dissociate] [--separate-git-dir <git dir>]
> [--depth <depth>] [--[no-]single-branch] [--no-tags]
> [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]
> [--jobs <n>] [--] <repository> [<directory>]
...
> <directory>
>
> 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?
Thanks,
A
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Git not creating new directory when cloning
2018-06-21 16:04 Git not creating new directory when cloning Jack Adrian Zappa
@ 2018-06-21 17:45 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-06-21 17:45 UTC (permalink / raw)
To: Jack Adrian Zappa; +Cc: git-mailing-list
On Thu, Jun 21, 2018 at 12:04:11PM -0400, Jack Adrian Zappa wrote:
> 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?
> > 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-21 17:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 16:04 Git not creating new directory when cloning Jack Adrian Zappa
2018-06-21 17:45 ` Jeff King
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).