39

I would like to download (as zip) a particular commit in Bitbucket. Unfortunately I can not find any facility in the UI to do it.

(I've already found out that I can see the source by copy and pasting the short hash of the commit after the url: https://bitbucket.org/myname/myproject/src/) Is this manual way only to browse the source code of a particular commit?)

1
  • my answer was one year earlier than the accepted answer and it is same.
    – siniradam
    Commented Feb 22, 2017 at 22:09

5 Answers 5

82

The url below should work. Just change required parts.

https://bitbucket.org/<username>/<reponame>/get/<commitCODE>.tar.gz

(without hypens)

2
  • Is there a way to provide credentials while calling this url? Since some of the repos are private in nature and needs login id and password of bitbucket to get access.
    – Anudeep S
    Commented Feb 4, 2022 at 11:55
  • @AnudeepS You can use curl: curl -s -S --user username:apppassword -L -O <URL>
    – siniradam
    Commented Feb 4, 2022 at 20:34
42

https://bitbucket.org/USERNAME/PROJECTNAME/get/COMMITNUMBER.tar.gz

note the uppercase in the URL. you will need to change them COMMITNUMBER can be found under commit for that specific commit.

8

You'll need to add the Tag for the particular commit and then you can Download it as a zip.

  1. Login to bitbucket.org
  2. Navigate to a particular Repository
  3. From the left pane click on Commits
  4. Click on the row for your desired commit
  5. Add a tag
  6. Click on Downloads from left pane
  7. Click on Tags and download the zip
1
  • 1
    this is an excellent answer to this question and still relevant today in late 2023
    – mknopf
    Commented Oct 28, 2023 at 14:34
3

To download a particular commit in Bitbucket go to : Repositories -> Select repository click on Downloads --> Branches. You will find all the commits made to the repository. Select which commit you want to download. To download as a zip file, click zip under download column.

1
  • 2
    This is not possible in 2021. Maybe they removed this feature from BitBucket.
    – Aleksandar
    Commented Jan 27, 2021 at 9:53
0

Please try to enter in Terminal "git checkout COMMIT-ID"

Replace COMMIT-ID with the commit id in your repo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.