Git Checkout at Previous Timeframe

Publikováno: 9.1.2019

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” […]

The post Git Checkout at Previous Timeframe appeared first on David Walsh Blog.

Celý článek

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.

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

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

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

The post Git Checkout at Previous Timeframe appeared first on David Walsh Blog.

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace