上一个时间段的Git Checkout

In the past I've blogged about checking out branches created on a specific date as well as sorting git branches by date, but one frequent usage of git and dates is checking out a commit at a given time in the past. For example, I often say "Weird, this feature was working a month ago" or "We removed that UI two months ago, how did it look again?". I don't care about the branch previous to the change, I just want to go back a given timeframe and see something.

过去,我写过关于签出在特定日期创建的分支以及按日期对git分支进行排序的博客,但是git和date的一种常见用法是在过去的给定时间签出一次提交。 例如,我经常说“很奇怪,该功能一个月前就可以使用”或“我们两个月前就删除了该UI,它又看起来如何?”。 我不在乎更改之前的分支,我只想返回给定的时间范围并看到一些东西。

The following git command allows you checkout the commit closest to the given date and time:

以下git命令允许您检出最接近给定日期和时间的提交:

git checkout 'master@{2018-09-01 01:00:00}'

This command is incredibly useful -- I use it almost daily!

该命令非常有用-我几乎每天都在使用它!

翻译自: https://davidwalsh.name/git-checkout-at-previous-timeframe

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值