Reputation: 720
Is it possible to configure an existing local clone of a git repository for sparse checkout?
Existing discussion points to performing git init
and git remote add -f origin <repo>
which results in long download times for my situation.
I already have a repository locally and I just want to configure it for sparse checkout and then switch to a particular branch.
Thanks very much!
Upvotes: 2
Views: 1794
Reputation: 5534
You still can use this answer: https://stackoverflow.com/a/4909267/2253302
But you should skip some steps (i.e git init
and git remote add -f origin <repo>
). I check this steps for my test repo:
git config core.sparseCheckout true
echo testSparseCheckout > .git/info/sparse-checkout
This scenario works for me well on my small testing git repo.
Upvotes: 1