siliconpi
siliconpi

Reputation: 8297

Force SVN update / checkout to overwrite local files

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 will 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

Upvotes: 15

Views: 72520

Answers (5)

Jules Clements
Jules Clements

Reputation: 488

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

Upvotes: 2

Carnix
Carnix

Reputation: 551

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.

Upvotes: 0

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!

Upvotes: 15

duffymo
duffymo

Reputation: 309008

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.

Upvotes: 3

iain
iain

Reputation: 1935

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

Upvotes: 5

Related Questions