如何克隆旧的 GIT 提交
我是一名正在接受培训的开发人员,还有一些空闲时间。我正在尝试重新继续一个已停止的项目,除了只读访问权限之外,我无法访问该存储库,因为我不拥有它。我需要获取它的旧快照的副本,因为它是最后一个稳定的快照。
我错过了什么吗?现在我只能通过“git clone xxx.git”获取最新版本 任何帮助将不胜感激:)
I'm a developer in training, with some spare time on my hands. I am trying to re-continue a discontinued project, and I don't have access to the repository besides read-only access, as I don't own it. I need to get a copy of an older snapshot of it, because it was the last stable one.
Am I missing something? Right now I can only get the latest version by "git clone xxx.git"
Any help would be appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用克隆时,您将获取整个存储库及其历史记录(因此所有提交版本)。因此,克隆后,您可以查看您想要使用的历史版本。
即 git checkout -bbranchNamebranchHash
When using clone your taking the entire repository and its history (so all commit versions). So after clone, you can then just checkout whichever historical version you are looking to work from.
i.e.
git checkout -b branchName branchHash
git clone 正在下载整个历史记录,而不仅仅是最新版本。尝试使用
git log
获取修订列表,然后使用git checkout [SOME REVISION]
将工作树重写为该提交git clone
is downloading the entire history, not just the latest version. Trygit log
to get the list of revisions, thengit checkout [SOME REVISION]
to rewrite your working tree to that commit