0

Having a full checkout of a repository, how can I convert it into a sparse checkout?

user7610
  • 25,267
  • 15
  • 124
  • 150

1 Answers1

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/

user7610
  • 25,267
  • 15
  • 124
  • 150