0

Is there any known way to access private repositories trough PHP using headers of any kind or any library to handle this?

I'm thinking of a way to download the ZIP file of the master repository using only CURL inside PHP directly to the server then perform some action on the zip...

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
MrK
  • 1,060
  • 9
  • 23
  • 1
    There are a few different options. Can you tell us more about your use case? Do you need users to permit you to access _their_ private repositories? – ChrisGPT was on strike Jul 11 '16 at 03:25
  • @Chris it's only for personal repositories I host at gitlab.com, I need to be able to fetch the code from gitlab and implement it into a production environment (will be used for classes and a custom mvc) – MrK Jul 11 '16 at 06:31

1 Answers1

2

I'm still not 100% clear on the details of what you're trying to do, but you should be able to download an archive of your repository using GitLab's "Get file archive" API endpoint using either a private token or a personal authentication token for authentication.

Both of these token types may be specified using a PRIVATE-TOKEN HTTP header.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257