将包含 zip 文件的旧备份移至版本控制 (mercurial)
以前,我时不时地使用 zip 文件进行备份,只需右键单击整个项目文件夹,发送到 zip,然后在文件名末尾添加一条小消息。
但现在我发现版本控制有多好,所以我想将所有旧的 zip 备份移到当前存储库中。最好的是,如果我可以在初始提交“之前”提交它(与我的最终zip文件相同),那么它看起来像是一个顺序开发。但是将其作为分支添加也不会太糟糕,无论如何都比将其放在 zip 文件中要好。
我的旧备份大约有 100 个 zip 文件,文件名非常一致: Backup Date Message.zip
我想我可以很容易地创建一个可以解压缩、提交、删除和重复的 bat 文件,但我想知道是否有更好的方法来做到这一点。特别是“在之前插入”部分,因为我还不是 Mercurial 的大师。我几乎只使用 TortoiseHG,而不是命令行。
Previously i've been taking backups using zip-files every now and then by just right-clicking my whole project folder, send to zip, and add a small message at the end of the filename.
But now i've discovered how good version control is so i want to move all my old zip-backups into the current repository. Best would be if i could commit it in "before" the initial commit (which is the same as my final zip-file) somehow so it looks like it was a sequential development. But adding it just as a branch wouldn't be too bad either, better than having it in zip-files anyway.
My old backup is about 100 zip-files, with very consistent filenames: Backup Date Message.zip
I guess i could quite easily create a bat-file that unzips, commits, deletes and repeats but i'm wondering if there is any better way of doing this. Especially the "insert before" part since i'm not exactly a master in mercurial yet. I almost exclusively use TortoiseHG, not the command-line.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你需要编写脚本。通常情况下,目录存档中的所有内容都不会进行修订控制(生成的文件和中间文件不会)。您可以编写一些脚本来查找“有趣”的扩展,然后将它们保存在修订控制中。
如果你想学习一些 Perl 或 Python,这听起来是一个机会。否则,将今天标记为 RCS 的开始并忘记它。
I'd think you would need to script it. Normally though not everything in a directory archive goes to revision control (generated and intermediate files don't). You could script something that looks for your "interesting" extensions, and just saves those in revision control.
Sounds like an opportunity if you want to learn some perl or python. Otherwise, mark today as your start in RCS and forgetaboutit.