# clone only basic branch details / metadata & checkout only root dir
git clone --filter=blob:none --sparse %your-git-repo-url%
cd %your-local-github-repo%
# can checkout sub-directory or individual file
git sparse-checkout add %subdirectory-to-be-cloned%
$ git clone --filter=blob:none --sparse [email protected]:hwchase17/langchain.git
$ cd langchain/
$ git sparse-checkout add docs
Can commit & push changes as usual
git checkout -b %new-branch-name% origin/%parent-branch-name%
git commit -m "Initial changes in sparse clone branch"
git push origin %new-branch-name%