Git Sparse Checkout Leaves No Entry on Working Directory

bitbucket, git

Solution

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 `/`, use `*` and leave no space at the end of the directory.

Then you may pull again or checkout the branch (`git checkout master`).

Problem

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: - SomeProjectRepo - JohnsProject - MarysProject - MyProject 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: - `cd E:\Temp\SomeProjectRepo` - `git remote add origin https://bitbucket.org/blah/blah` - `git init` - `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. `MyProject\`, `SomeProjectRepo\*`, `SomeProjectRepo\MyProject\`, etc, etc) but none worked. How do I use sparse-checkout (or any other tools) to only work on "`MyProject`"?

Original source

Related problems