Re: date based checkouts in git possible?

From: Warner Losh <imp_at_bsdimp.com>
Date: Sat, 04 Jun 2022 14:49:49 UTC
On Fri, Jun 3, 2022 at 11:17 PM Chris <bsd-lists@bsdforge.com> wrote:

> I'm in need of checking out the ports tree as it was
> at an earlier date. But for the life of me, I can't
> seem to cobble up an/the incantation.
>
> All the suggestions I've read indicate something to
> the effect of
> git checkout `git rev-list -n 1 --before=<previous-date>" freebsd/main`
> which returns
> Your branch is up to date with 'freebsd/main'.
>
> What must I do? Or will I need to convert/import it into svn?
>

git checkout main@{<date>}

You may need to protect the {} from csh/tcsh eating them. You can also add
a time.
See the git-rev-parse man page for all the details.

Note, due to the temporal anomalies that sometimes are present in git,
the commit date and the author date differ, which can cause confusion
if you do a git log and not a git log --prety=fuller.

Warner