Git Sparse Checkout Leaves No Entry on Working Direcotory
I am trying to use sparse-checkout to just check-out a directory from a BitBucket repository, but getting a “Sparse checkout leaves no entry on working directory” error when I try to pull.
The BitBucket repository has the following directory structure:
I have a local directory on E:\Temp\SomeProjectRepo on my Windows 7 laptop. I want to just checkout/pull “MyProject” from the BitBucket repository to my local directory, so I can just work on E:\Temp\SomeProjectRepo\MyProject.
So I created “E:\Temp\SomeProjectRepo” and did the following in DOS:
git remote add origin https://bitbucket.org/blah/blah
git config core.sparsecheckout true
echo MyProject > .git/info/sparse-checkout
git pull origin master
At step 6, I get the “Sparse checkout leaves no entry on working directory”. I have tried different syntax in step 5 (e.g.
SomeProjectRepo\MyProject\, etc, etc) but none worked.
How do I use sparse-checkout (or any other tools) to only work on “
One Solution collect form web for “Git Sparse Checkout Leaves No Entry on Working Direcotory”
OK, I got this working. As I expected it was not working because of step 5.
The line below works now:
echo "MyProject/*"> .git/info/sparse-checkout
The important thing is to use
* and leave no space at the end of the directory.
Then you may pull again or checkout the branch (
git checkout master).