Created
March 10, 2014 23:34
-
-
Save madrobby/9476733 to your computer and use it in GitHub Desktop.
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -H 'Authorization: token INSERTACCESSTOKENHERE' -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/owner/repo/contents/path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@W1BTR You need to pay attention to the token scope, if the repository is on another organisation repo, when you generate the PAT choose that organisation instead of your own GH account.
I had the same issue and re-created the token on the correct organization. The URL is fine. Also one must use
Accept: application/vnd.github.raw+jsonfor RAW file content.