Through the GitHub API it is possible to retrieve individual files from a Git repository via, e.g. curl
. To do so, first retrieve the content information for the relevant file (or folder):
curl https://api.github.com/repos/{organisation}/{repository}/contents/{file or folder path}
For private repositories, authenticate using your username and a personal access token