TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Is there something like “today X years ago” but for Git?

2 pointsby whoibrarover 2 years ago
Google photos has something called memories [0], which shows the photos taken on a today&#x27;s date but from x years ago. So, today photos from 20-Aug-2011, 20-Aug-2015, 20-Aug-2020 all show up at one place.<p>Since, git as a Version control system tracks changes as tiny as single character. I was wondering if there was something where I could enter a date and it will show me how the repository looked like on that particular day, or even better show how file(s) has changed in weeks, months, years and probably decades.<p>[0] : https:&#x2F;&#x2F;techcrunch.com&#x2F;2015&#x2F;08&#x2F;20&#x2F;google-photos-introduces-rediscover-this-day-to-help-you-reminisce&#x2F;

3 comments

Tomteover 2 years ago
Are you looking for git checkout &#x27;main@{1 year ago}&#x27;<p>See also <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-rev-parse" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-rev-parse</a>, that works with all kinds of git subcommands.<p>BTW, git doesn&#x27;t track every change, only when you add the change.
评论 #32536284 未加载
shooover 2 years ago
For a single file you can use `git log` to show you all patches that changed the file, going back in history forever:<p><pre><code> git log --follow --patch -- some&#x2F;file </code></pre> It composes with Tomte&#x27;s @{1 year ago} tip if you want to start reading at a particular point in time:<p><pre><code> git log --follow --patch &#x27;main@{1 year ago}&#x27; -- some&#x2F;file </code></pre> ref: <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-log" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-log</a>
beverettover 2 years ago
There is <a href="https:&#x2F;&#x2F;retrogit.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;retrogit.com&#x2F;</a> that sends you emails on what happened in repositories on this day, similar to memories.