如何在不执行结帐的情况下更新 SVN 文件? [英] How to update a SVN file without performing a checkout?

查看:36
本文介绍了如何在不执行结帐的情况下更新 SVN 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一些脚本来使用较新版本的 xml 文件更新 Linux 机器的 SVN 存储库.存储库很大,并且同一个盒子上没有结帐版本.这个想法是在没有工作副本的情况下更新 xml.这是可能的还是我需要签出到临时文件夹、复制/覆盖、签入和删除临时文件夹?

I am writing some scripts to update the Linux box's SVN repo with newer versions of xml files. The repo is huge, and there is no checkout version on the same box. The idea is to update the xml without a working copy. Is that possible or do I need to checkout to a temporary folder, copy/overwrite, check in and delete temporary folder?

非常感谢您到目前为止的回答.

Thanks very much for your answers so far.

我知道你可以用 API 和代码来做,不确定是否有任何 SVN 命令这样做......

I know that you can do it with API and code, not sure if any SVN command does so...

非常感谢.

推荐答案

是不想结账的问题,还是因为害怕结账就得结账很多文件?

Is the issue that you don't want to bother with the checkout, or because you are afraid that if you do a checkout, you'll have to checkout a lot of files?

您必须在 Subversion 中进行结帐.您不能在没有工作副本的情况下简单地提交更改.(不完全正确,您可以在没有结帐的情况下执行 svn deletesvn mkdir.)

You have to do a checkout in Subversion. You can't simply submit changes without a working copy. (Not entirely true, you can do svn delete and svn mkdir without a checkout.)

但是,您可以使用 --depth 开关限制检出的文件数量.例如,您可以执行以下操作:

However, you can limit the amount of files that do get checked out with the --depth switch. For example, you can do the following:

$ svn co --depth=empty http://myserver/myrepos/mydirectory

这将检出目录,但其中没有任何文件.然后,您可以仅对要修改的文件执行 svn update,然后提交这些更改:

This will checkout the directory, but without any files in it. You can then do an svn update of just the files you want to modify, then commit those changes:

$ cd mydirectory            #Enter the empty working copy just checked out
$ svn update fileToChange   #Adds file you want to change to your working dir
$ edit fileToChange.xml
$ svn commit -m "Modified 'fileToChange.xml' with latest version"

这将允许您更改文件 fileToChange.xml 而无需检出整个目录.

This will allow you to change the file fileToChange.xml without having to checkout the entire directory.

这篇关于如何在不执行结帐的情况下更新 SVN 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆