如何在Web服务器上正确设置SVN?

发布于 2024-08-19 06:09:02 字数 728 浏览 5 评论 0原文

我发现 这个问题,但它从未得到解决,并且不想为自己劫持它。我会尽力提供尽可能多的细节。

我在 Linux 服务器(即我的 Web 服务器)上有一个共享托管帐户,并且我具有 shell 访问权限。

我正在使用 TortoiseSVN 在 Windows 计算机上工作。

我在托管服务器上的 public_html/ 中有几个网站,并且希望能够将我的 Windows 计算机上所做的任何更改以最小的麻烦传播到服务器。我基本上不想通过 FTP 手动上传。

我很乐意保留我的所有修订,但实际上不需要真正看到它们,当然不是从网络界面看到它们。我想从网上看到的只是当前的修订版。

希望这就是大部分细节,现在是实际问题。 将 SVN 设置为在我的 SVN 中工作的最佳方式是什么 public_html 文件夹而不暴露我的所有内容 .svn 向公众提供目录?

I have found this question, but it was never resolved and don't want to hijack it for myself. I'll try and give as many details as possible.

I have a shared hosting account on a Linux server which is my web server, and I have shell access.

I'm working from a Windows machine using TortoiseSVN.

I have several web sites in my public_html/ on the hosting server and would like to be able to have any changes made on my Windows machine be propagated to the server with minimum fuss. I basically want to get away from manually uploading over FTP.

I would be happy to keep all my revisions, but don't actually ever need to see them really, certainly not from a web interface. All I want to see from the web is the current revision.

Hopefully that's most of the detail sorted, now for the actual question. What's the best way to set my SVN to work in my public_html folder without exposing all my .svn directories to the public?

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

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

发布评论

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

评论(2

囍孤女 2024-08-26 06:09:02

我建议不要在生产中使用签出工作副本。上传到生产环境的最佳方式是导出。如果您想要自动执行某些操作,您可以查看一些部署脚本,例如 Capistrano。

如果您仍然想这样做..您可以使用 htaccess 来隐藏它们:

<FilesMatch "\.svn/.*">
   order deny,allow
   deny from all
</FilesMatch>

<Files .htaccess>
   order deny,allow
   deny from all
</Files>

I would advice against using a checkout working copy on production. The best way to upload to production is export. If you want something automatically you could look into some deployment script like Capistrano.

If you still want to do it .. you could use a htacccess to hide them:

<FilesMatch "\.svn/.*">
   order deny,allow
   deny from all
</FilesMatch>

<Files .htaccess>
   order deny,allow
   deny from all
</Files>
Oo萌小芽oO 2024-08-26 06:09:02

您可以将 Apache 配置为禁止访问 .svn 目录,但您仍然需要远程服务器能够访问本地 Subversion 存储库,以及需要配置的所有内容和< /em> 安全:加密、身份验证、路由器、防火墙...

我认为灵活性和简单性之间的最佳折衷实际上是使用 FTP,但使用文件同步工具来完成。您可以将工作副本导出到临时目录并从那里同步,也可以将工具配置为忽略 .svn 目录。同步过程可能很慢,但自动化并不重要。

另外,不要忘记非版本化文件。有些需要手动更新(例如从版本化模板创建的设置文件),有些需要忽略(例如缓存文件和用户数据)。

至于完成这一切的神奇工具......我仍在寻找合适的工具。到目前为止,我正在使用 SyncBack 免费软件。它可以完成这项工作,但它被设计为备份工具,因此很难配置。

You can configure Apache to disallow access to .svn directories but you'd still need that your remote server has access to your local Subversion repository, with all the stuff that needs to be configured and secured: encryption, authentication, routers, firewalls...

I think the best compromise between flexibility and simplicity is actually using FTP but doing it with a file synchronization tool. You can either export your working copy into a temporary directory and synch from there or configure the tool to ignore the .svn directories. The synchronization process can be slow but being automated it doesn't really matter.

Also, don't forget about non-versioned files. Some need to be updated manually (such as setting files created from versioned templates) and some need to be ignored (such as cache files and user data).

As about the magic tool to do this all... I'm still looking for right one. So far, I'm using SyncBack freeware. It does the job but it's designed as a backup tool so it can be hard to configure.

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