简体   繁体   English

SVN导出但排除某些文件?

[英]SVN export but exclude certain files?

I need to export my checked-in codebase on the production server, but need to exclude certain files from being overwritten. 我需要在生产服务器上导出签入的代码库,但需要排除某些文件以免被覆盖。

Is there a way of "exporting" (or equivalent) content (without the .svn folders, etc that are created) and excluding certain files? 有没有一种方法可以“导出”(或等效的)内容(没有创建的.svn文件夹等)并排除某些文件?

What I do presently is export everything and do the changes manually, but am thinking of exporting to a clean directory, copying the necessary files and changing the directory name to the correct one. 我现在要做的是导出所有内容并手动进行更改,但是我正在考虑导出到一个干净的目录中,复制必要的文件并将目录名更改为正确的目录。

Create a patch with your changes: 使用您的更改创建补丁:

svn export . /tmp/exported
cp -pr /tmp/exported /tmp/exported.orig
# do your changes to /tmp/exported
cd /tmp
diff -urNP exported.orig exported > "$HOME"/local-changes.patch

Then when you do export then first export then apply changes: 然后,当您导出时,先导出,然后应用更改:

svn export . /tmp/exported --force
( cd /tmp/exported; patch -p1 < "$HOME"/local.changes.patch )

This way you'll get an error, when your modified files would change so much that your changes will not apply cleanly. 这样,当修改后的文件变化太大以至于您的更改将无法完全应用时,您将得到一个错误。 If you just copy files then if, for example, a configuration option will be added to configuration file, then your system will break mysteriously. 如果仅复制文件,则例如,如果将配置选项添加到配置文件,则系统将神秘地损坏。

It depends what you use to access your SVN command (command-line svn? Tortoise? Eclipse SVN plugin?) 这取决于您用来访问SVN命令的内容(命令行svn?Tortoise?Eclipse SVN插件?)

With Tortoise SVN, to export : right-click in your repo -> ToirtoiseSVN -> export. 使用Tortoise SVN,要导出:右键单击您的存储库-> ToirtoiseSVN->导出。 With Tigris Eclipse plugin, to ignore file : right-click on your file -> Team -> add to svn:ignore ; 使用Tigris Eclipse插件,可以忽略文件:右键单击文件-> Team->添加到svn:ignore; to export : right-click on your trunk (or repo) -> Team -> Export 导出:右键单击您的中继(或仓库)->团队->导出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM