gitbitbucket

git clone with filtering (filtering not recognized by server, ignoring. bitbucket remote)


I am trying to clone part of a repo. I saw some posts regarding filtering and it looks like it should be possible to filter a clone and be able to push from the shallow repo with the latest versions of git. I have a misc repo that contains several small projects and would like the ability to only deal with one or two at a time. Say I have a directory in the root of the repo named matrix, would this be the correct syntax to clone part of it?

 git clone url --filter=sparse:path=matrix 

I got an error "filtering not recognized by server, ignoring" and guess that may be regarding bitbucket, right?

Thanks!


Solution

  • The remote git server you are cloning from (Bitbucket) doesn't seem to include support for partial cloning at this time. Note that as of git v2.19.0 there was no official server support provided by git itself. See this answer for more details, including on how this feature can be enabled and tested locally.

    However, there seems to be an early stage experimental Alpha support implemented in GitLab that might allow you to use this feature with their server implementation.