If you want to clone a subdirectory instead of your entire Git repo, you can disable the pipeline's default codebase and then run your
git commands in a Run step.
You can also use this pattern if you need to use specific
git clone arguments to clone your codebase.
Disable Clone Codebase
You must disable Clone Codebase so that you can clone the repo according to your specifications. If Clone Codebase is enabled, then the build clones the pipeline's default codebase automatically.
In the Visual editor, you can disable Clone Codebase in the Build stage's Overview tab.
In the YAML editor, set
false in the
Add a Run step to clone the codebase
git sparse-checkout ...