clone远程代码 在不同电脑上git_如何在Git中从指定日期克隆远程(GitHub)存储库...

本文介绍了如何克隆Git仓库后将其回滚到特定日期的状态。通过克隆仓库获取完整历史记录,然后使用`git log`筛选目标日期的提交,再通过`git checkout`命令切换到该日期的SHA哈希值,即可得到所需版本。
摘要由CSDN通过智能技术生成

I'm trying to clone a git repository from a certain date. Even if this is not possible. Is it possible to clone the git repository and then roll it back to a certain date?

Example: my repository has been updated since May 2010, but I'd like to get the version from June 5th. I'd like to run the following command:

git clone git@github.com:projectfolder -date 06-05-2010

解决方案

Cloning the repository will give you the entire commit history of all the source code.

You need only scroll back through git log and find the desired commit on your target date. Running git checkout SHA where SHA is the commit hash will give you the state of the source code on that date.

edit:

git log --since=2010-06-05 --until=2010-06-06 will help narrow it down!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值