Skip to content

How can I download an LFS file through the GitLab API? #1304

@nice-jiang

Description

@nice-jiang

How can I download an LFS file through the GitLab API?

My GitLab version is gitlab/gitlab-ce:15.11.13-ce.0.

The version of gitlab4j-api I am using is:

<dependency>
    <groupId>org.gitlab4j</groupId>
    <artifactId>gitlab4j-api</artifactId>
    <version>5.6.0</version>
</dependency>

Please provide a Java code example.

I have tried using .getRepositoryFileApi().getRawFile(), but I keep getting a pointer file (e.g., version https://git-lfs.github.com/spec/v1 ...) instead of the actual file content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions