I need to write a script (bash) to download a single file from a private BitBucket repo. I have done it with 'git archive', but I would like to use curl. All the tests I have done only download a file with lots of html tags in it, I never get the actual file.
There's an "open raw" option in the source view for each file in the repo:
That will give you the raw file, without the additional HTML content you'd see in a browser. You can see an example of it at https://bitbucket.org/mirror/linux/raw/master/Makefile or https://bitbucket.org/mirror/linux/raw/b6839ef26e549de68c10359d45163b0cfb031183/Makefile - the first link will always take you to the latest version of that file in the master branch, and the second link will always take you to that specific commit's version of that file.
Thank you Jim, I have been asked to automate the download via a bash script. The main reason is that my organization has lots of repos. All of them have a specific file I need to download to a local drive and extract some information. So, I need to go through all the repos and collect those files, so the only option is via a script so I can automate it.
Horst
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.