Skip to content

Clone git repository at specific revision

I often have to check a codebase at an older state, so it would be beneficial to checkout the whole repository at that revision. While that is not directly possible, there is a workaround:

git clone https://example.com/my-project.git
cd my-project
git reset --hard <commit hash of the wanted revision>

(source)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.