-3

git init leaves alone any existing files and subdirectories in the target directory.

How does git clone deal with any existing files and subdirectories in the target directory?

halfer
  • 19,824
  • 17
  • 99
  • 186
Tim
  • 1
  • 141
  • 372
  • 590
  • 1
    Possible duplicate of [What's the best practice to "git clone" into an existing folder?](https://stackoverflow.com/questions/5377960/whats-the-best-practice-to-git-clone-into-an-existing-folder) – Liam Jan 14 '19 at 16:29
  • I am asking what it does, not what is the best I shall do. – Tim Jan 14 '19 at 16:32
  • 4
    I did a quick test and it doesn't do anything `fatal: destination path 'test' already exists and is not an empty directory.` – evolutionxbox Jan 14 '19 at 16:51

1 Answers1

0

git clone refuses to clone into an existing, non-empty directory. Therefore no problem can ever occur, except of course for the fact that git clone says no.

(Prior to Git 1.6.3 or so, git clone refused to clone into an existing directory even if it was empty.)

torek
  • 448,244
  • 59
  • 642
  • 775