Situation
I managed to create a local git repository in my laptop by pulling a single subdirectory of the master branch in a remote repository. I have followed the instructions given in this post on https://stackoverflow.com/a/13738951/5459638. I use git version 2.22.0.
The path of the subdirectory, with respect to https://gitlab.com/<user>/<project>/tree/master
as given in the project web page, is contained in the file .git/info/sparse-checkout
, say
subdir1/subdir11/
The command
git pull mylaptop master
does create a local copy of the intended directories. This is confirmed with a tree -d
. mylaptop
was a name of choice for the local repository. This worked fine.
Issue
I then wanted to fetch a sibling directory and its child from the same remote too, say
subdir1/subdir12/
I added this path as a new line in the sparse-checkout file and run the git pull command above. However, the outcome is
From https://gitlab.com/<user>/<project>
* branch master -> FETCH_HEAD
Already up to date.
and I see no change in the local tree.
Research
Out of several suggestions I came across in Stackoverflow, I gave it a try to git update-index --skip-worktree
, but to no avail. I did this out of intution and would avoid blind trials though. It is not a question of trailing slashes in the paths either.
Question
Apparently I am missing something that makes Git realize that the list has been extended. What could this be?