Search code examples
gitgit-clone

Git clone particular version of remote repository


I cloned a remote git repository about a month ago. The remote repository has undergone many changes and has now become unstable. Now I need another copy of the repository, version identical to the one I cloned a month ago.

How do I do this?


Solution

  • You could "reset" your repository to any commit you want (e.g. 1 month ago).

    Use git-reset for that:

    git clone [remote_address_here] my_repo
    cd my_repo
    git reset --hard [ENTER HERE THE COMMIT HASH YOU WANT]