Git: Querying commits by date range in 1 minute

Makzan
·
·
IPFS
·
`git reflog --since production@{2021-01-01} production@{2021-03-30}`

Hey there, this is Thomas from Macao.

In my last video, I have shown the basic usage of the git reference log.

If we remember the commit was at a specific time, say one week ago, we can show the reference logs by time by using git reflog master{1.week.ago}. That means showing the reflog until one week ago.

On the other hand, If we want to show the reflog since a specific time, we can use `git reflog --since master@{1.week.ago}`.

We can also specify a date range by combining since and until. For example, the command: `git reflog --since production@{2021-01-01} production@{2021-03-30}` shows where the production branch was within the 1st quarter of 2021.

This date range querying allows us to go back to a certain state of the working directory like a time machine.

CC BY-NC-ND 2.0 授权

喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!

logbook icon
Makzan我管理世界職業技能競賽之網站技術項目、舉辦本地設計與開發賽事、開課分享技術心得。一個用網頁來表達自己的作家。
  • 来自作者
  • 相关推荐

期望與放下

甚麼是世界職業技能競賽

【最後兩天】買《所謂「我不投資」,就是 all in 在法定貨幣》親身體驗擁有 NFT