How to update a SVN file without performing a checkout?

后端 未结 5 1477
故里飘歌
故里飘歌 2020-12-30 02:46

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

5条回答
  •  佛祖请我去吃肉
    2020-12-30 03:16

    There is a way to "update" a file without a working directory, but this is going to depend on what you want to do. I many cases where I do some automated checkins like this, I have found this solution good enough:

    You can use svn import to update the files

    Something like:

    svn import -m "updating the xml" local.xml http://server/path/to/repo/server.xml
    

    Catch is that you cannot import an already existing file, so you will have to issue a delete and then import:

    svn delete -m "deleting for update" http://server/path/to/repo/server.xml
    

    You lose the history, but is a very simple and lightweight way to update file and is completely dependent on what you are doing. If you are not comfortable with the deletion and loss of history, you have to use the methods suggested by other answers.

提交回复
热议问题