- Head to the repo where the file you want to download is located, click on the file, then 'raw'. Take note of the URL and file name with extention.
- Execute the following command in terminal
curl -O FILE_NAME.EXTENTION https://raw.githubusercontent.com/GITHUB_USERNAME/REPOS/BRANCH/FILE_NAME.EXTENTION
- The file should now be downloaded and saved to your home directory.
- To run the file, execute:
/usr/local/bin/python3 FILE_LOCATION
-
Head to the repo where the file you want to download is located, click on the file, then 'raw'. Take note of the URL in the format https://raw.githubusercontent.com/GITHUB_USERNAME/REPOS/BRANCH/FILE_NAME.EXTENTION?token=STRING_OF_LETTERS_AND_NUMBERS
-
Then go to GitHub settings > Developer settings > Personal access tokens > Generate new token. Make sure to give it a memorable note and to tick 'Full control of private repositories'.
-
Suppose the token is abcd1234; rearrange the URL so it follows the form: https://abcd1234@raw.githubusercontent.com/GITHUB_USERNAME/REPOS/BRANCH/FILE_NAME.EXTENTION. Observe that '?token=STRING_OF_LETTERS_AND_NUMBERS' has been removed, and the token has been placed in front of the URL, followed by an @.
-
Now that you have a URL in the form cURL recognises, excecute it with the command:
curl -O https://abcd1234@raw.githubusercontent.com/GITHUB_USERNAME/REPOS/BRANCH/FILE_NAME.EXTENTION
- The file should now be downloaded and saved to your home directory.
- To run the file, execute:
/usr/local/bin/python3 FILE_LOCATION
Option | Description |
---|---|
-o | Write output to file instead of stdout |
-O | Write output to a local file named like the remote file we get |
-s | Silent or quiet mode. Do not show progress meter or error messages |
-v | Download using verbose mode |
-# | Hashtag progress bar |