Git克隆特定版本的远程存储库 [英] Git clone particular version of remote repository

查看:111
本文介绍了Git克隆特定版本的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约一个月前我克隆了一个远程git存储库。远程存储库经历了许多变化,现在变得不稳定。现在我需要另一个版本库,版本与我在一个月前克隆的版本相同。



我该怎么做?


<解决方案

使用 git-reset 为此:

  git clone [remote_address_here] my_repo 
cd my_repo
git reset --hard [ENTER这里的提交哈希你想要]


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?

解决方案

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]

这篇关于Git克隆特定版本的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆