Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9352

Closed
Open
Created Jun 03, 2015 by Administrator@rootOwner

How to get a file which under directory via REST API?

Created by: BrickXu

Hi all, ENV: GitLab 7.2.1 ff1633f4

I want to get some config files via REST API, and I find it in the docs (/help)

GET /projects/:id/repository/blobs/:sha

It works well when I get the file in the repository root path, but it seems that does not support to get a file under the directory with filepath

curl -G -H "Content-type: application" http://my-gitlab-domain/api/v3/projects/10070/repository/blobs/init --data-urlencode private_token=xxxxx --data-urlencode filepath=conf/kernel.conf

it returns 404 File Not Found, but conf/kernel.conf exist in the repo.

Assignee
Assign to
Time tracking