Clone/download a subdirectory of a git repository
Posted: Fri May 15, 2020 4:09 pm
I'm trying to download a copy of just libc++/libc++abi from the LLVM git repo.
I was following the answer here: https://stackoverflow.com/questions/600 ... repository
However, at 'git remote add', it tries to download nearly 1GB of data (the entire repo.)
How can I just clone/download the two subdirectories I care about?
I was following the answer here: https://stackoverflow.com/questions/600 ... repository
Code: Select all
git init
git remote add -f origin https://github.com/llvm/llvm-project.git
git config core.sparseCheckout true
git config pull.ff only
echo "libcxx/" >> .git/info/sparse-checkout
echo "libcxxabi/" >> .git/info/sparse-checkout
git pull --depth=1 origin master
How can I just clone/download the two subdirectories I care about?