I have invoked a Git partial clone to clone a repository without any blobs:
git clone --filter=blob:none https://server/repo.git
Now I would like to experiment with this repository to see which operations are locally possible without Git dynamically fetching missing objects from the promisor remote. Is there some Git config option to disable dynamic fetching and instead let me run into "missing object" errors?
Support for partial clones is still a work in progress, so there may be better solutions for this in the future.
As of right now, Git will only fetch missing objects from promisor remotes. From the documentation:
Dynamic object fetching will only ask promisor remotes for missing objects. We assume that promisor remotes have a complete view of the repository and can satisfy all such requests.
This is listed as a limitation, so it may very well change in the future. However, as of right now, you can use this to your advantage by simply telling Git that the origin
remote isn't a promisor by saying:
git config remote.origin.promisor false
I'd go with removing the remote. Either by removing the remote from the .git/config
file or running git remote remove origin
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With