I'd like to find an easier way to grab a file from a private GitHub repository.
I managed to download a file via curl
by creating a personal access token on GitHub, and then using it like this:
curl https://[email protected]/accountName/repoName/branchName/fileName.txt
This works for me, however I was wondering if there's an easier way, perhaps using SSH? I wouldn't mind having to type my SSH password as it seems more convenient than creating an access token. I can already authenticate successfully on GitHub:
$ ssh -T [email protected]
# Attempts to ssh to GitHub
However, when I try using curl
with an SSH URL, I get this error:
curl ssh://[email protected]:accountName/repoName/branchName/fileName.txt
curl: (3) URL using bad/illegal format or missing URL
I tried some other methods described in this article, to no avail.
Any ideas?