开发者

Force SVN update / checkout to overwrite local files

开发者 https://www.devze.com 2023-03-01 17:10 出处:网络
i\'m planning to run(on my server!) svn update to update my LIVE website with updates. However, i\'m worried about \'C\' conflicts which w开发者_开发技巧ill prevent my site scripts from functioning.

i'm planning to run (on my server!)

svn update

to update my LIVE website with updates. However, i'm worried about 'C' conflicts which w开发者_开发技巧ill prevent my site scripts from functioning. How can I force the checkout / update process to overwrite all local files (on my server!)?

I know one solution would be to do this on a separate directory - any thing else more efficient?

i've looked at Force an SVN checkout command to overwrite current files

I dont have --force option


If you don't have --force option i think you do not have either the --accept. The svn update have a new option called --accept to "specify automatic conflict resolution action". It could be: postopone, mine-conflict, theirs-conflict, edit, launch, theirs-full, mine-full or base.

An svn help update will help!


Would clicking the directory and Reverting it to the base then updating have the same effect?


You should ask Subversion to update your working copy. If merges are necessary, Subversion will tell you. If not, you'll have the latest of everything else.

I think a better solution is to merge your code into Subversion, completely blow away your working copy, and then checking out clean from the project.

Your repository should contain all meaningful code, not your working copy.


I could go on about artefact management and content delivery independent to source control, however as I understand it, this is refreshing web server content directly from SVN, where the web server content may have been altered manually. If you are wanting to script this then "clicking the directory" will not work, however this is what I use

svn update --accept theirs-full


I know this is a super old question, but I was trying to find how to do this myself and came up with this:

svn status --no-ignore | grep '^\?' | sed 's/^\? //' | xargs -Ixx rm -rf xx

Basically, this lists all unversioned files in your repository, then pipes that list to a forced rm to for purging. This deleted ALL unversioned files without prompt, so make sure you know what you're doing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号