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

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、付费专栏及课程。

余额充值