0

I use svn on Linux. I did svn update succesfully. After I did the update I wanted to see the status so I did svn status. I can see that I have 3 files with M (e.g M sarit/src/main.cpp). How can I force those files to update/overwrite?

axiac
  • 68,258
  • 9
  • 99
  • 134
sara8
  • 199
  • 3
  • 11

1 Answers1

2

How can I force those files to update/overwrite?

Update and overwrite mean different things. On svn update, each file is updated. This means each file contains the latest changes committed to the repository by other developers since the last time you updated it and the changes you did on it since the last time you committed it (if there are any changes).

svn status reports these files as Modified. This means you have changes not committed on this files.

If you want to overwrite the local copies of your files with the versions received from the repository then your local changes will be lost.

If you are sure this is what you want (discard your changes) then you can revert these files to the content they had when you last time updated them.

The command is svn revert. Run svn help revert to get more info about it.

Update:

As user @bahrep suggests, it's better to read the SVN Book first. It explains the key concepts of a versioning system and how they are implemented in Subversion. It also explains the svn commands, with examples. The help you get using svn help <command> is useful when you know how to use svn and what's the expected outcome of each command and you only need a quick recall of the arguments needed by a specific command.

A quick tour on using Subversion can be found on the Basic Work Cycle page.

axiac
  • 68,258
  • 9
  • 99
  • 134
  • 1
    I'd better refer to SVNBook instead of `svn help foo`: http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html#svn.tour.cycle.resolve.revert & http://svnbook.red-bean.com/nightly/en/svn.ref.svn.c.revert.html – bahrep Apr 04 '16 at 21:53