问题
Having a full checkout of a repository, how can I convert it into a sparse checkout?
回答1:
Run
git config core.sparseCheckout true
then create .git/info/sparse-checkout
/*
!excluded-dir/
then run
git checkout master
and excluded-dir
will disappear.
My problem was that I did not put a trailing slash behind the excluded directory in my .git/info/sparse-checkout
Much thanks to http://www.richsomerfield.com/post/2014-03-05-adventures-in-git-sparsecheckouts/
来源:https://stackoverflow.com/questions/42626469/how-do-i-convert-full-checkout-to-sparse-checkout