{"thread":{"id":"48754","subject":"Git not creating new directory when cloning","startedAt":"2018-06-21T16:04:17Z","lastAt":"2018-06-21T17:45:27Z","messageCount":2,"participants":["Jack Adrian Zappa","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"350652","messageId":"CAKepmagD1VgRx+79rS9Swe8OL8SOwvRn6Yn-u_FCUy-OCUMeFQ@mail.gmail.com","threadId":"48754","inReplyTo":null,"subject":"Git not creating new directory when cloning","fromName":"Jack Adrian Zappa","fromEmail":"adrianh.bsc@gmail.com","sentAt":"2018-06-21T16:04:11Z","receivedAt":"2018-06-21T16:04:17Z","isPatch":false,"sender":{"key":"adrianh.bsc@gmail.com","avatar":null},"body":"Hi, I was trying to clone a repo into a non-existent directory. but it\ngave me a failure:\n\n$  git clone  https://github.com/jelera/vim-javascript-syntax.git\n~/.vim/bundle/vim-javascript-syntax\nfatal: destination path\n'/home/username/.vim/bundle/vim-javascript-syntax' already exists and\nis not an empty directory.\n\n(the command was taken from install procedure from\nhttps://github.com/jelera/vim-javascript-syntax)\n\nThe directory \"/home/username/.vim/bundle\" already existed, but\n\"'/home/username/.vim/bundle/vim-javascript-syntax\" did not.  Upon\ncreating the \"vim-javascript-syntax\" sub-directory, the clone command\nsucceeded.  From what I read from the docs\n(https://git-scm.com/docs/git-clone):\n\n> git clone [--template=<template_directory>]\n> [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror]\n> [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>]\n> [--dissociate] [--separate-git-dir <git dir>]\n> [--depth <depth>] [--[no-]single-branch] [--no-tags]\n> [--recurse-submodules[=<pathspec>]] [--[no-]shallow-submodules]\n>  [--jobs <n>] [--] <repository> [<directory>]\n...\n> <directory>\n>\n> 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.\n\nWhich to me, implies that the directory doesn't have to exist prior to\ncloning.  So is this a bug or a misunderstanding?\n\nThanks,\n\n\nA\n"},{"id":"350658","messageId":"20180621174523.GB30249@sigill.intra.peff.net","threadId":"48754","inReplyTo":"CAKepmagD1VgRx+79rS9Swe8OL8SOwvRn6Yn-u_FCUy-OCUMeFQ@mail.gmail.com","subject":"Re: Git not creating new directory when cloning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-21T17:45:23Z","receivedAt":"2018-06-21T17:45:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jun 21, 2018 at 12:04:11PM -0400, Jack Adrian Zappa wrote:\n\n> Hi, I was trying to clone a repo into a non-existent directory. but it\n> gave me a failure:\n> \n> $  git clone  https://github.com/jelera/vim-javascript-syntax.git\n> ~/.vim/bundle/vim-javascript-syntax\n> fatal: destination path\n> '/home/username/.vim/bundle/vim-javascript-syntax' already exists and\n> is not an empty directory.\n\nThat exact command works just fine for me. Are you absolutely sure that\nthe directory did not exist?\n\nWhich version of Git are you using?\n\n> > The name of a new directory to clone into. The \"humanish\" part of\n> > the source repository is used if no directory is explicitly given\n> > (repo for /path/to/repo.git and foo for host.xz:foo/.git). Cloning\n> > into an existing directory is only allowed if the directory is\n> > empty.\n> \n> Which to me, implies that the directory doesn't have to exist prior to\n> cloning.  So is this a bug or a misunderstanding?\n\nCorrect, in general it should _not_ exist.\n\n-Peff\n"}]}