Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Retrofit manual snapshots into Git
2 points by niftich on Feb 11, 2017 | hide | past | favorite
Hi HN,

Back before I was using Git or Mercurial to store revisions of my text files and code, I would make manual snapshots as of a point-in-time, by copying the files into a directory named with a date. The modification time on the copies would be preserved. In addition to this manual "version control", my backup processes would generate point-in-time snapshots as well.

I want to go back through these files and put them into a real version control system, such that the commits will losslessly reflect the content of files as of a particular date, if we assume my existing manual snapshots are the full and complete truth.

What are some ways of accomplishing this, if the resulting repo is 100% private and need not be structured for public dissemination? The result need not be in Git, but it should be in a distributed VCS that's open source.

Naively, I can sort all files by modtime ascending, and commit each and every instance where the content differs. But this means that a full rebuild is necessary if I were to discover additional snapshots. Is there a way to reliably splice a past revision into history?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: