To efficiently clone only a specific subset of a large Git repository, you can use sparse checkout. This approach is useful when you don't need the entire repository content, saving both time and storage. Below is a step-by-step guide to achieving this.
I have been trying to make sparse checkout work for a while and the following solution has finally worked. https://askubuntu.com/a/1464994/1928663