There are at least 3 previous questions explaining how to clone a repository without the .git directory:
From those questions, it seems you can't just run git clone and have the repository cloned without the .git directory.
Yet, in the majority of repos I've cloned, such as the one in the command below, no .git directory is made.
git clone https://github.com/scotch-io/scotch-box.git
What determines whether a straight forward git clone command creates a .git directory or not?
There is always a .git directory after a git clone. No exception. If you don't see it then it is hidden (How this happens depends on your operating system. ls on linux does not show files/dirs that start with a dot. You would have to use ls -a.)
The .git directory is essential as it contains all files and info used by git.
Here is what happens after the git-clone you mentioned:
/tmp % git clone https://github.com/scotch-io/scotch-box.git
Cloning into 'scotch-box'...
remote: Counting objects: 83, done.
remote: Total 83 (delta 0), reused 0 (delta 0), pack-reused 83
Unpacking objects: 100% (83/83), done.
Checking connectivity... done.
/tmp % cd scotch-box
/tmp/scotch-box (git)-[master] % la
total 40K
drwxr-xr-x 4 t t 4.0K 12. Aug 14:10 .
drwxrwxrwt 8 root root 12K 12. Aug 14:10 ..
drwxr-xr-x 7 t t 4.0K 12. Aug 14:10 .git
-rw-r--r-- 1 t t 18 12. Aug 14:10 .gitignore
-rw-r--r-- 1 t t 7.4K 12. Aug 14:10 README.md
-rw-r--r-- 1 t t 480 12. Aug 14:10 Vagrantfile
drwxr-xr-x 2 t t 4.0K 12. Aug 14:10 public
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With