3 ms·
Ask HN: Is there something like “today X years ago” but for Git?
Google photos has something called memories [0], which shows the photos taken on a today'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.
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.
[0] : https://techcrunch.com/2015/08/20/google-photos-introduces-rediscover-this-day-to-help-you-reminisce/
- Tomte 4y agoAre you looking for git checkout 'main@{1 year ago}' See also https://git-scm.com/docs/git-rev-parse https://git-scm.com/docs/git-rev-parse, that works with all kinds of git subcommands. BTW, git doesn't track every change, only when you add the change.
- brasic 4y agoA fun thing is that the full gitrevisions syntax used by `rev-parse` is supported many places on GitHub where you would normally put an object id or ref name. For example, https://github.com/git/git/tree/master@{5.years.ago} https://github.com/git/git/tree/master@{5.years.ago} Note that this uses the reflog which means that it won’t work in some situations (branch renames, entries rolled off the end of the log, etc)
- beverett 4y agoThere is https://retrogit.com/ https://retrogit.com/ that sends you emails on what happened in repositories on this day, similar to memories.
- shoo 4y agoFor a single file you can use `git log` to show you all patches that changed the file, going back in history forever: git log --follow --patch -- some/file It composes with Tomte's @{1 year ago} tip if you want to start reading at a particular point in time: git log --follow --patch 'main@{1 year ago}' -- some/file ref: https://git-scm.com/docs/git-log https://git-scm.com/docs/git-log