Subversion 的隐藏修订文件

发布于 2024-07-09 07:17:28 字数 208 浏览 6 评论 0原文

您知道 Subversion 如何在隐藏的 .svn 文件夹中存储它签出的每个文件的副本吗? 我正在构建的网站非常大(有超过 1Gig 的 PDF 文件)。 这些 PDF 文件在网站存在期间很少会发生变化。

我想知道是否有一种方法告诉 Subversion 它不应该存储一组特定文件(我的 PDF 文件)的本地修订副本,而只是在对这些文件中的任何一个进行更改时与服务器同步?

You know how Subversion stores a copy of every file it has checked-out in the hidden .svn folders? The website I'm building is pretty big (has over 1Gig of PDF files). These PDF files will very rarely change throughout the existence of the website.

I was wondering if there was a way of telling Subversion that it shouldn't store a local revision copy of a certain set of files (my PDF files) but just sync with the server whenever a change is made to any of these files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ま昔日黯然 2024-07-16 07:17:29

您可能需要考虑使用 svn export 而不是结帐来管理网站的“实时”副本。 这将完全避免.svn文件夹中大文件的问题。

您的工作流程可能如下所示:

  1. 在本地编辑文件,在测试部署中进行测试
  2. 将更改提交到存储库
  3. 从存储库到实时系统运行 svn 导出

这样做的缺点是可能已进行的任何更改同时实时系统将被覆盖。 但您可以安排工作流程来避免这种情况。

实际上,我不知道您是否担心工作结帐中或服务器部署中的这些隐藏 PDF 文件。 如果它在您的工作结账中,那么我不知道如何使用 Subversion 来避免这些文件。 但是,如果您将 Git 与 git-svn 一起使用,那么 Git 将管理自己的压缩历史记录,而无需所有文件的完整副本。

You might want to consider managing the "live" copy of your website using svn export instead of a checkout. This would completely avoid the problem of large files in .svn folders.

Your workflow could be like this:

  1. Edit files locally, test in test deployment
  2. Commit changes to repository
  3. Run a svn export from the repository to the live system

The disadvantage of this is that any changes that might have been made to the live system in the meantime will get overwritten. But you can arrange your workflow to avoid that.

Actually, it occurs to me that I don't know whether you are concerned about these hidden PDF files in your working checkout, or in the server deployment. If it's in your working checkout, then I don't know of a way to avoid these files using Subversion. However, if you use Git with git-svn, then Git will manage its own compressed history without full copies of all the files.

挽梦忆笙歌 2024-07-16 07:17:29

另一个想法是:如果您使用 Bazaar+bzr-svn 或 Git+git-svn,它们会保留一个更节省空间的工作副本,并且您仍然可以直接从存储库进行更新。

An idea in a different vein: if you use Bazaar+bzr-svn or Git+git-svn, they keep a much more space-efficient working copy and you can still update directly from your repository.

时光与爱终年不遇 2024-07-16 07:17:29

正如 Greg 所说,使用 SVN 导出 - 但将 SVN 导出到本地目录,然后将该本地目录同步到远程站点。

这使您获得 (a) 没有 .svn 目录和 (b) 仅将更改从本地系统发送到远程的组合。

如果失败,正如 Greg 和 orip 所建议的那样,使用“git-svn”进行远程结帐。 它仍然比 svn 导出消耗的空间有一定的开销,但它会小于完整的 svn 工作副本。

As Greg says, use an SVN export -- but do the SVN export to a local directory, and then rsync that local directory to the remote site.

This gets you the combination of (a) not having the .svn directories and (b) only sending the changes from the local system to the remote.

Failing that, as both Greg and orip suggested, make the remote checkout using 'git-svn'. It still has some amount of overhead over the space consumed by an svn export, but it will be less than a full svn working copy.

情感失落者 2024-07-16 07:17:28

Subversion 使用 .svn 文件夹中的版本能够将新文件与旧文件进行比较,并将差异发送到 Subversion 服务器。

所以不,没有办法不将文件放在 .svn 文件夹中,但仍然允许您提交这些文件

Subversion uses the version in the .svn folders to be able to diff the new file against the old file, and send just the differences to the subversion server.

So no, there's no way to not have the files inside the .svn folders, that still allows you to commit these files

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文