Skip to content

Retrieve a raw file from a repository

GET
/api/v4/projects/{id}/repository/files/{file_path}/raw

Retrieves the raw file contents for a specified file in a repository.

id
required
string

The project ID

Example
gitlab-org/gitlab
file_path
required
string

The URL-encoded path to the file.

Example
lib%2Fclass%2Erb
ref
string
nullable

The name of branch, tag or commit

Example
main
lfs
boolean
nullable

Retrieve binary data for a file that is an lfs pointer

OK

Bad Request

Not Found