Is it possible to always (force) overwrite local changes when updating from SVN? Ignore conflicts?

十年热恋 提交于 2019-11-30 04:36:57
tato

If you really want a copy of HEAD (the latest revision in repos), then you should

svn revert -R <path> // discard all your changes inside path (recursive)
svn update           // get latest revision of all files (recursive)

That's it.

Beware that you will lose ALL your changes since your last 'commit'.

EDIT: added the -R <path> from Isu_guy answer for the sake of completeness and helping readers find a single full answer

lsu_guy

tato's answer is absolutely correct and please heed his caution. You will lose ALL your changes. Just a clarification on syntax and some nuances

svn revert is non-recursive by default and needs a path to work on. To make is recursive add "-R". If you are in the current directory use "./" for the "path" below or use an absolute path like "/path_to_your_folder"

svn revert -R <path>

svn update is recursive. If you are in the directory you don't need a path at all

svn update
Carnix

I'd do this:

svn up --accept tf

or

svn up --accept theirs-full

That said, "svn revert -R" then "svn up" at the root of your working copy would also do the trick. In my case, I have several WCs for various projects, so I run a shell script that updates all the them when I start up my computer. I don't use accept, rather I use "--accept p" to postpone resolution since it's an automated process, then I merge any conflicts that SVN can't automatically merge on it's own (usually, this involves reverting, but it depends).

Using svn 1.6.11 (as shipped by CentOS 6.4) Carnix's command should look like

svn up --accept theirs-full

(cant add a comment since I don't have enough reputation)

Answering your first question. No. But you can override your local files by running the following commands from the root of your project:

svn revert -R .
svn update

This worked on my mac with svn 1.7.19 and ubuntu with svn 1.8.8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!