GitHub: URL to raw files

前端 未结 3 371
不思量自难忘°
不思量自难忘° 2021-01-07 11:14

I have some Eclipse extension projects hosted by GitHub. These projects also include the related update sites. I thus need an URL to the raw data that Eclipse can use to dow

3条回答
  •  日久生厌
    2021-01-07 11:25

    The url is indeed https://raw.githubusercontent.com/username/projectname, but it only applies to files, not the project itself (which would return 400: Invalid request)

    https://raw.githubusercontent.com/username/projectname/branchName/file
    

    For instance:

    https://raw.githubusercontent.com/VonC/compileEverything/master/make_env.sh

    This is different from a project archive (tarball or zip) download, which does download the full repo.
    See get archive link:

    GET /repos/:owner/:repo/:archive_format/:ref
    

    with:

    • archive_format string Can be either tarball or zipball.
      Default: tarball
    • ref string A valid Git reference.
      Default: the repository’s default branch (usually master)

    For instance:

    https://api.github.com/repos/VonC/compileEverything/zipball/master

提交回复
热议问题