hasen
hasen

Reputation: 166102

svn update is not updating!

I want svn update to overwrite my local file with the files from the server, even if my local files have modifications, I want to throw them away and use the version that's on the remote repository.

How do I do that? I tried svn update --force but it doesn't work.

Update:

Thanks for the answers, so I'm using revert like this:

svn revert . -R

Is this how I'm supposed to use it? is it safe? I have a git repository in the same pace and I don't want svn to corrupt my .git for me!

Upvotes: 31

Views: 58517

Answers (9)

Grant Johnson
Grant Johnson

Reputation: 327

I just wanted to add a little to what diyism posted.

I didn't see the . next to the ; in the line

svn revert -R .; svn up

and it confused me. I don't know why you need to explicitly use . for all files when using revert and you don't using update but that seems to be the way it is.

So, in case it helps anyone, I thought it would be more clear to see the answer as two lines

svn revert -R .
svn update

Upvotes: 16

glennr
glennr

Reputation: 2199

I have this problem occasionally on OSX (10.6, currently using svn 1.6.16). A workaround is to do this:

 svn update `svn ls -R`

It can be slow though.

Ref: http://code.google.com/p/support/issues/detail?id=3192

Upvotes: 5

diyism
diyism

Reputation: 12935

Use this line:

svn revert -R .;svn up

Upvotes: 2

Troy Hunt
Troy Hunt

Reputation: 20387

Worst case, delete the contents of your working copy (excluding the .svn folder) and do an update.

Upvotes: 0

Dirk Vollmar
Dirk Vollmar

Reputation: 176159

By the way, that's actually a feature of SVN. It will never overwrite any of your modifications when updating (unless you explicitly throw them away using revert.

Upvotes: 4

p01nd3xt3r
p01nd3xt3r

Reputation: 841

use svn revert

Upvotes: 1

dr Hannibal Lecter
dr Hannibal Lecter

Reputation: 6721

You have to revert your modifications, and if necessary do an update after that.

Upvotes: 2

Benjamin Ortuzar
Benjamin Ortuzar

Reputation: 7831

You should use SVN revert. This would revert the files in your working copy to their original state. For more information and examples check the svn book here: http://svnbook.red-bean.com/en/1.1/re25.html

Upvotes: 37

Otávio Décio
Otávio Décio

Reputation: 74250

Use "Revert" instead.

Upvotes: 3

Related Questions