Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to use wget to pull a file from BitBucket?

Kirtesh Garg August 26, 2016

In case a specific file needs to be downloaded wget works pretty well - https://bitbucket.org/#####/<repository>/raw/<tag>/<path to file>. But if I need to download all files present under a branch - I am using following command line -

wget -N --reject "index.html*" -e robots=off --user='#####' --password='#####' -l1 -r -np https://bitbucket.org/#####/bulkimagerenderer-service/raw/0.6/bulkimagerenderer-service-restapi/deploy/

Nothing gets downloaded. It works well with SVN. What command line updates we need to make for BitBucket?

OR Git clone is the only option for such a scenario?

2 answers

4 votes
b1naryb0y February 14, 2018

Hey Kirtesh,

I found this answer in another forum. You need to add files to the Downloads section in each repo, and then you're able to get a download link for those files for the below code.

 

curl --user username -L -O  https://bitbucket.org/account/repo/downloads/myfile.tar.gz
Ajay Mummadi September 30, 2018

Thank you very much. This worked like a charm.

Josh Glendenning March 5, 2019

This worked for me for a while but now I always get a 403 Forbidden in response. Anyone else run into that?

Like Vlad Moyseenko likes this
0 votes
Kim Taylor September 1, 2016

I think what you're after is covered by git archive.

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events