suggested an edit with a nice python snippet that unfortunately got rejected as to big of a change to the answer. For easier use you can wrap it in a script. Access the Linux terminal on Windows, develop cross-platform applications, and manage IT infrastructure without leaving Windows. The -O will save the contents in a local file with the same name as the remote file name. Install a complete Ubuntu terminal environment in minutes on Windows with Windows Subsystem for Linux (WSL). This might look something like this: curl \ Be sure to use the Accept-header for custom media types to get the raw data. Instead of calling the url above you can then use github's API to access the content of a file. Contribute to CLI Try GitHub on the command line GitHub CLI brings GitHub to your terminal. git-repository is not possible (as far as I know), because of how the data is stored.Įdit: When you want to access a file from a private repo, you first have to create an access token with the appropriate permissions in your account settings. GitHub CLI is open source and ready for your contributions. You can retrieve the raw file using something like wget.Īccessing a single file directly from a. Instead of $changeset_hash you can also provide a branch (e.g. You will see, that you can access it by: $changeset_hash/path/to/file If you go to the page and view the links provided by "raw" (in the top left corner, when viewing the file).
0 Comments
Leave a Reply. |