News for hackers. Stuff that matters.
Re:Ask HN: Is there something like “today X years ago” but f... by Tomte on Saturday August 20, 2022 @12:25PM (#32533193)
Are you looking for git checkout 'main@{1 year ago}'

See also 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.

Re:Ask HN: Is there something like “today X years ago” but f... by brasic on Saturday August 20, 2022 @08:16PM (#32536284)
A 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}

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)