Skip to content

How to fetch blobs from remote or alternate repositories #2149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kammerjaeger opened this issue May 5, 2025 · 0 comments
Open

How to fetch blobs from remote or alternate repositories #2149

kammerjaeger opened this issue May 5, 2025 · 0 comments

Comments

@kammerjaeger
Copy link

For CI processes we have repositories that are cloned with "--filter=blob:none".
Also we have a repository cache folder that we set via ".git/objects/info/alternates".

When we try to access the blob contend it fails, is there a way to download the blob from the remote repository?
For alternates objects I can probably just copy the objects over manually but I would prefer proper lib support.

What I'm looking for is something like https://git-scm.com/docs/partial-clone/2.49.0#_fetching_missing_objects
Manly ideas how to custom implement this or an integrated solution when using the lib.

Reproduction steps

Example repo setup:

git init $GITHUB_WORKSPACE/git --bare
git remote add origin [email protected]:${{ github.repository }}.git
echo "/git-cache/${{ github.repository }}.git/objects" >> ./objects/info/alternates
git fetch --no-tags --no-recurse-submodules --filter=blob:none origin ${{ env.DefaultBranch }}

Actual behavior

Depending on function: No valid git object identified by 'sha xxxxxx' exists in the repository.

Version of LibGit2Sharp (release number or SHA1)

0.31.0

Operating system(s) tested; .NET runtime tested

Win 11 / Debian | Net Core 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant