How to download earlier version of source code from bitbucket without any tools

KY November 11, 2020

Hi there,

I was given a task to push source codes to bitbucket server and I have no issue in doing so using the git command. However, I am stuck when I was told to restore the source codes for an earlier commit. Assuming that I have make 10 commits for the source code and I wish to restore the codes for the 5th commit point. How can I pull the whole set of codes ? The download command shall download the latest codes and that is not what i wanted. Please advise. 

Thank you  

1 answer

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 11, 2020

Bitbucket do not have a feature to do a clone of a specific commit, mainly because Git does not have that option. To get a specific commit just clone the repository as normal and then you can do a git reset <commit> --hard

As of Git 2.5.0 you can ignore the security in Git and do a shallow clone to a specific commit, but both your server and client needs to be on Git 2.5.0 or above. Have a look at Why Isn't There A Git Clone Specific Commit Option? for more information.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events