Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to always overwrite local changes when updating from SVN?

Tags:

svn

I have a file in a Subversion repository which changes almost every time it's opened in the IDE, thus creating conflicts on almost every update.

Is it possible to force SVN to always overwrite the local file with the one in the repository, even if there are local changes?

EDIT: It's a VB6 project file. Those contain GUIDs of the referenced ActiveX classes and their local file names. When a project is opened, the local file names are automaticall updated. It has to be under version control because the application cannot be built without it.

like image 299
Daniel Rikowski Avatar asked Sep 14 '09 07:09

Daniel Rikowski


People also ask

Does svn update remove local changes?

The svn update command never discards or removes local changes made in your working copy.

Does svn checkout overwrite files?

When you check out with the --force option, any unversioned file in the checkout target tree which ordinarily would obstruct the checkout will still become versioned, but Subversion will preserve its contents as-is.

How do I get rid of local changes in svn?

If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert.

How does svn update work?

svn update brings changes from the repository into your working copy. If no revision is given, it brings your working copy up to date with the HEAD revision. Otherwise, it synchronizes the working copy to the revision given by the --revision ( -r ) option.


2 Answers

Firstly, I feel sorry for you for having to work in VB6.

Secondly, I suppose what you really need to do is delete the file before you update. So in this case, you could have a bat file called 'do update', and you just double-click that, instead of actually using TortiseSVN (or whatever) to do the updates. You make this bat delete it, and then, unsurprisingly, update.

Incredibly lame, but I do see your problem that the file needs to be in source control, yet you want to disregard general changes unless explicitly committed.

like image 101
Noon Silk Avatar answered Oct 05 '22 11:10

Noon Silk


I guess that this is a file, which is always dynamically created/modified by your IDE.

I think if you add this file to the svn:ignore settings, this would better fit your needs. Look at the svn-configuration for more details. This setting makes your SVN ignore this file on adding or importing. With it you could also keep your local changes to the file, in case you have the necessity to do so at one point.

like image 23
Kosi2801 Avatar answered Oct 05 '22 12:10

Kosi2801