How do I convert simple non source controlled project backups into a versioned git repository?

前端 未结 5 742
孤独总比滥情好
孤独总比滥情好 2021-01-04 22:15

I have been extremely naughty. I have been developing a piece of software (I\'m the only developer) for a little while (O.K., it\'s over the course of a few years), but have

5条回答
  •  天命终不由人
    2021-01-04 23:04

    I don't quite know why you don't want to just commit all snapshots individually. I mean, a shell script (or Perl, Python, Ruby, Tcl, whatever) to do that, is probably less than 5 lines of code and less than 10 minutes of work.

    Also, there is git load-dirs, which would allow you to cut that down to maybe 3 lines and 5 minutes. But you still have to load every dir indvidually.

    But, if you are so inclined, there is the git fast-import tool which is intended to make writing repository converters and importers easier. According to the manpage, you could write an importer in about 100 lines and a couple of hours.

    However, all this ignores the biggest problem: the value of a VCS lies not in the contents – you could just as well use regular backups for that – but in the commit messages. And no magic tool is going to help you there, you'll have to type them all in yourself … and more importantly, you'll have to remember exactly why you made every single little change over the last years.

提交回复
热议问题