Downloading a file from own repository

How can I download a file from my repository?

I can log in or I can request something with a token from

But I always get 404 as response.

Could you describe exactly how you’re trying to download the file?

I tried it with the urls given by github and https.

I do not know, how I can get a valid URL for a file in my repository to be able to download it. It seams that the URLs under “raw” with the token expire very soon.

And with login and RBTCGP/NeoLoad/blob/komplett/PH78.yaml I get “The connection was unexpected disconnected”

wget https://RBTCGP:PASSWORD@github.com/RBTCGP/NeoLoad/blob/komplett/PH78.yaml wget : Die Anfrage wurde abgebrochen: Die Verbindung wurde unerwartet getrennt…
In Zeile:1 Zeichen:1

You’ll need to create a PAT and send that in the Authorization header to download from the raw URL, as described here:

That example uses curl, but you should be able to do the same thing with the --header option of wget.

Many thanks, it works!

Nevertheless, is there also a possibility to get a link to a zip of the files in a repository branch without putting them into a folder and zipping the folder? I need the files in the root of the folder.

You can use the URL behind the “Download ZIP” field in the popup that shows up if you click the green “Code” button on your repository page. The Authorization header works just the same. :slightly_smiling_face:

Yes, but this puts the files into a folder and zips the folder. I need the files in the root of the zipped folder without any folder inbetween.

There’s no built-in mechanism for that. You could set up an Actions workflow to build a ZIP just like you need it, but I’d just move files into place after extraction (write a script to do that) unless the ZIP needs to be processed by some tool you can’t adjust.