I know I can get the project through git clone
command, but is there any way, how to download the project through the web interface from BitBucket.org?
In the best way, I am looking for a way to download a project source as ZIP compress file.
For git repositories, to download the latest commit, you can use:
https://bitbucket.org/owner/repository/get/HEAD.zip
For mercurial repositories:
I was trying to figure out if it's possible to browse the code of an earlier commit like you can on GitHub and it brought me here. I used the information I found here, and after fiddling around with the urls, I actually found a way to browse code of old commits as well. Even though the question/answer is about downloading the code of an earlier commit, I thought I'd just add an answer for browsing the code also.
When you're browsing your code the URL is something like:
https://bitbucket.org/user/repo/src/
and by adding a commit hash at the end like this:
https://bitbucket.org/user/repo/src/a0328cb
You can browse the code at the point of that commit. I don't understand why there's no dropdown box for choosing a commit directly, the feature is already there. Strange.
In Bitbucket Server you can do a download by clicking on ...
next to the branch and then Download
For more info see Download an archive from Bitbucket Server
In case you want to download the repo from your shell/terminal it should work like this:
wget https://user:[email protected]/user-name/repo-name/get/master.tar.bz2
or whatever download URL you might have.
Please make sure the user:password are both URL-encoded. So for instance if your username contains the @
symbol then replace it with %40
.
Source: Stackoverflow.com