Re: date based checkouts in git possible?
- In reply to: Warner Losh : "Re: date based checkouts in git possible?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 05 Jun 2022 04:46:21 UTC
On 2022-06-04 07:49, Warner Losh wrote: > 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>} Brilliant! > > You may need to protect the {} from csh/tcsh eating them. Yep. I did. > 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. Thanks, Warner. That's the magic incantation I needed. I'll add it to my list. Sorry for the bother. But the svn way of looking/thinking is still pretty ingrained and I struggle with events in history being a HoH as opposed to a date. > > Warner Thanks again! Chris