Tortoise SVN - 导出特定于目标的文件

时间:2015-10-05 13:49:55

标签: svn export tortoisesvn tagging

我在带有tag-branch-trunk-structure的本地WAMP-maschine上运行Tortoise-SVN 1.9.1。我正在向几台服务器发布html& php-code 每个文件都有一些特定于该服务器的文件(保存用户名/密码条目或本地路径设置)。

在开始使用svn之前,每个服务器都有这些(凭证)文件的文件版本,当发布到某个服务器时,必须选择正确的服务器特定文件集。 现在,使用svn,我为新版本和标记服务器特定的包创建了一个分支,仍然手动选择正确的特定文件。 我希望通过svn可以以任何方式自动化以消除错误。

有人可以给我一个提示,除了几个加上3个特定文件标记“server_A”之外,最好的做法是什么? 除了几个加上3个不同的文件以标记“server_B”之外的所有文件。

由于

1 个答案:

答案 0 :(得分:1)

This suggestion is based on using svn but is not the best way to do it. The best answer for your requirement would be to create a build script to create a zip file for each server by lifting files from the trunk and server specific folders (also in trunk) and packaging them together. Look at ant for a simple build system. You then just need to tag your trunk folder and you are done.

However if you prefer to do it in svn as per your question, this is how to do it.

  • Files in trunk are the files for your main development
  • Create a branch for each server specific distribution
  • In each of these branches put your server specific changes with the passwords and commit.
  • Whenever you make changes to trunk that need to make it to all servers you have to merge trunk to each branch (I would do this with a small batch file at the command line). Commit each branch
  • At this point each branch will have a correct version of the code for each server.
  • You can then tag the whole of the branches folder or even the whole repo as the release number.