How to clone a old commit in Bitbucket

Mohan Ramanathan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 7, 2018

I am trying to checkout a older commit in Bitbucket, Tried the solutions given in this thread https://stackoverflow.com/questions/14528344/how-to-access-full-source-of-old-commit-in-bitbucket 

Nothing worked for me, I think Bitbucket got updated a lot. I am able to clone only the newer commit.

Please guide me how to download the older version of the project in Bitbucket.

1 answer

1 accepted

7 votes
Answer accepted
Julius Davies _bit-booster_com_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2018

I assume you are trying to "download" a snapshot of your repo at a given commit, rather than trying to clone?  The "git clone" command brings down all commits and after cloning you would simply type "git checkout <commit-id>" within the cloned repo to jump around to see different snapshots of the repo from different moments.

If you are trying to "download" a specific snapshot as I suspect, the StackOverflow answer you linked to is still correct. Try this (but fill in "[user]", "[repo]", and "[commit-id]" with the specific values that pertain to your situation):

https://bitbucket.org/[user]/[repo]/get/[commit-id].zip

 

For example, for the stash-auto-unapprove-plugin repo, this downloads all source code as of commit e7843d047:

https://bitbucket.org/atlassian/stash-auto-unapprove-plugin/get/e7843d047495daeeb5752e6c4a767eb54c4c281d.zip

Mohan Ramanathan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 10, 2018

Thank you, It worked. I just did "git clone" of the project and then made "git checkout COMMIT-ID" replaced the COMMIT-ID with the commit id in my repo.

Martha Nisa
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 12, 2019

thanks it worked for me

adnaanad2006
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2019

Thanks, it worked...

Ankit Kamboj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2019

Thank you very much, yes it work like a charm

Gurmukh1991
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 27, 2019

worked perfect

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events