I have a remote named git@github.com:MyOrg/my-repo.git
There are several folders within its root directory.
I only want to fetch ONE of them, named datadog
.
I am running the following commands
$ g clone --no-checkout --depth=1 git@github.com:MyOrg/my-repo.git
Cloning into 'my-repo'
...
...
...
$ cd my-repo
$ git sparse-checkout init
$ git sparse-checkout set datadog
$ ls -al
total 0
drwxr-xr-x 3 pantelis wheel 96B Oct 8 12:39 .
drwxrwxrwt 37 root wheel 1.2K Oct 8 12:39 ..
drwxr-xr-x 13 pantelis wheel 416B Oct 8 12:41 .git
$ g sparse-checkout list
datadog
$ g checkout master
Already on 'master'
Your branch is up to date with 'origin/master'.
$ ls -al
total 0
drwxr-xr-x 5 pantelis wheel 160B Oct 8 12:41 .
drwxrwxrwt 37 root wheel 1.2K Oct 8 12:39 ..
drwxr-xr-x 14 pantelis wheel 448B Oct 8 12:41 .git
drwxr-xr-x 9 pantelis wheel 288B Oct 8 12:41 datadog
drwxr-xr-x 4 pantelis wheel 128B Oct 8 12:41 terragrunt
Where did that terragrunt
directory come from? I know it is in my repo's root by why was it added in my sparse-checkout
?
update: If I use the --cone
option when initialising sparse-checkout
it will indeed add only datadog
folder but also ALL other root files (README.md
, LICENSE.md
etc) which isn't the desired behaviour either.