Project contains 52 directories - how do I checkout only 1 directory? clone copies all 52 directories

Replace this template with your information

Describe your question in as much detail as possible:

  • What are you seeing, and how does it differ from what you expect to see?
    Project contains 52 directories - how do I clone/checkout only 1 directory? The users have no uses for the 51 other directories
  • Consider including screenshots, error messages, and/or other helpful visuals
  • What version are you on (Hint: /help) ? and are you using self-managed or gitlab.com?
  • What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

Thanks for taking the time to be thorough in your request, it really helps! :blush:

The project aironum contains 52 directories of which aironum.aironum-beta-v6.1.5.1 is the one I want to clone
If I do
git clone git@gitlab.inria.fr:swornom/aironum
I clone all 52 directories which is not what I want
if I do
git clone git@gitlab.inria.fr:swornom/aironum/aironum-beta-v6.1.5.1
I get the error
Cloning into ‘aironum.aironum-beta-v6.1.5.1’…
remote:
remote: ========================================================================
remote:
remote: The namespace you were looking for could not be found.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.

What is the correct way to achieve what i want?

You can find the full instructions here.

Basically,

git init git@gitlab.inria.fr:swornom/aironum
cd aironum
git remote add -f origin git@gitlab.inria.fr:swornom/aironum

git config core.sparseCheckout true

echo "some/dir/" >> .git/info/sparse-checkout
echo "another/sub/tree" >> .git/info/sparse-checkout

This tells git which directories you want to checkout. Then you can pull just those directories

git pull origin master