如何设置svn自动导出到public_html?

发布于 2024-08-19 07:37:51 字数 735 浏览 1 评论 0原文

我刚刚开始使用 svn 所以如果我看到任何愚蠢的事情请帮助我。

我正在使用 tortoisesvn 在 Windows 笔记本电脑上进行开发。 我正在部署到 Linux 服务器。

我已经在我的笔记本电脑上设置并签出了我的存储库。 我无法将其签出到服务器上的目录。我已为其创建了一个目录,但无法获取svn checkout file:///...< /代码> 工作!根据本教程checkout 命令采用以下内容形式:svn checkout file:///repository_name/project/trunk project 但是什么是 repository_name 我的存储库位于 /home/username/svn,我不记得命名该存储库,只记得它所在的目录。

一旦我确实进行了排序,我希望将存储库自动导出到当我从笔记本电脑提交时该目录。 这可能吗?

很抱歉,如果这非常不清楚,但我想详细说明。

基本上,我想从我的笔记本电脑提交,并触发将新提交的文件导出到服务器上的目录。

I'm just getting started with svn so please, help me out if I saw anything stupid.

I'm developing on a windows laptop using tortoisesvn.
I'm deploying to a linux server.

I have my repo set up and checked out on my laptop.
I can't manage to check it out to a directory on the server. I've created a directory for it but can't get svn checkout file:///... to work! Based on this tutorial the checkout command takes the following form: svn checkout file:///repository_name/project/trunk project but what is the repository_name? My repo is at /home/username/svn, I don't remember naming the repo other than saying what directory it's in.

Once I do actually have that sorted I would like to have the repo automatically export to that directory when I commit from my laptop. Is that possible?

Sorry if that's horribly unclear but I wanted to be detailed.

Basically I want to commit from my laptop and have that trigger an export of the newly commited files to a directory on the server.

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

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

发布评论

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

评论(3

猥琐帝 2024-08-26 07:37:51

也许 Ubuntuforums 上的此讨论会有所帮助(前提是您的存储库和 Web 服务器在 Linux 上运行)。它解释了提交后挂钩的概念,并显示了实际的示例脚本。

Maybe this discussion on Ubuntuforums helps (provided your repo and web server are running on Linux). It explains the concept of Post Commit Hooks, and shows actual example scripts.

卸妝后依然美 2024-08-26 07:37:51

有两种不同的方法可以自动导出到 public_html 文件夹,这两种方法都涉及设置提交后挂钩。您可以:

  1. 设置 提交后挂钩< /a> 将在您的 Windows 笔记本电脑上运行,并将必要的文件复制到您的服务器,可能通过 scp (可在 Putty 套件)、rsync,甚至是 samba 文件共享
  2. 设置 Linux 服务器来托管存储库,以便它可以完全访问 public_html 文件夹所在的文件系统,然后设置一个提交后挂钩,将必要的文件复制到 public_html 文件夹。当然,您需要从 Linux 存储库而不是笔记本电脑上的存储库中签出,但这可能是值得的。

现在,您上面所说的一些事情有点……令人困惑。我做了一些与上述一致的假设,所以如果我的假设错误,请发表评论。

现在,您的笔记本电脑上既有存储库又有结帐。而且,听起来您已经使用了 file:// 协议进行结帐。如果是这样,您将无法从 Linux 服务器访问您的存储库(是的,如果您还通过 SSH 或 http 提供存储库)。这可以解释为什么您无法在 Linux 中使用相同的文件协议进行结帐 - 它无法访问您的 Windows 文件系统。

鉴于上述情况,我将尝试上面的第一种方法。编写一个脚本(或程序)将文件复制到 Linux 服务器。

There are two different ways you can automatically export to your public_html folder, both of which involve setting up a post-commit hook. You could:

  1. Setup a post-commit hook that will run on your Windows laptop and copy the necessary files to your server, perhaps through scp (available in the Putty suite), rsync, or even a samba file share.
  2. Setup your Linux-server to host your repository so that it has full access to the filesystem on which your public_html folder exists, and then setup a post-commit hook that copies the necessary files to your public_html folder. Of course, you would need to checkout from the Linux repository instead of the one on your laptop, but it might be worth it.

Now, a couple of things you've stated above are a bit... confusing. I've made some assumptions that reconcile the above, so please comment if I have mis-assumed.

Right now, you have both the repository and a checkout on your laptop. And, it sounds like you have used the file:// protocol for your checkout. If so, you will not be able to access your repository from your Linux server (yes, it is possible if you're also serving your repository over SSH or http). This would explain why you can't get a checkout using the same file protocol within Linux -- it doesn't have access to your Windows file system.

Given the above, I would try approach number one above. Write a script (or program) that copies the files to your Linux server.

梦年海沫深 2024-08-26 07:37:51

如果您尝试将 svn 注释的副本复制到可以查看的目录(而不是实际处理它),则应该使用 svn export 命令。

If you're trying to get a copy of your svn coment to a directory where you can view it (as opposed to actually working on it), you should use the svn export command.

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