1

I'm versioning only a repo folder with git sparsecheckout. I followed the instructions on this blog. I already had the repo, so what I did was:

git config core.sparsecheckout true

echo api/ >> .git/info/sparse-checkout

git read-tree -mu HEAD

It worked, but it also added other api folders inside the project, but I only want to add the top level api folder, not all apifolders in the project.

Any idea how to make this work?

arielcr
  • 1,663
  • 2
  • 23
  • 34

1 Answers1

0

I confirm using /api/ should work.

The git sparse-checkout command is using a pattern format explained in git read-tree, where a leading slash references the root folder directory.
See an example here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250