views:

176

answers:

2

I'm relatively new to SVN and have a rather basic question.

I have several small versioned resource images for a web project. Today the designer updated one of those resources, so I should replace it.

Is the only way to update this file by first svn-delete it, commit and then svn-add the new one?

EDIT
As mentioned in the response, I could just overwrite the file.
Last time I tried that, I got a bunch of checksum errors on commit. Must have been some other reason..

+5  A: 

If the new file has the same name svn should detect this as change to the file. So just copy the new file into the directory and replace the old one.

Also, see explanation of svn's binary file handling.

wierob
Hmm, last time I did that I got checksum errors. I had to remove the file in the repository, move the file out of the working directory. Update. Add the moved file back in my working directory and commit again. Sure this isn't gonna happen to me again?
borisCallens
That's the way svn works with every file. The only difference here is that it is a binary file which only means you can't merge it if some one else makes changes.
wierob
Well, I tried it again and this time it worked. Renders my question a bit stupid though :P
borisCallens
+1  A: 

Hi there,

Firstly, are you trying to checkin this new verison into the repository, or are you trying to fetch the version checked in by the designer?

  1. If you need to checkin the new file version, there is no need to delete from SVN repo really. Simply replace the file in its orginal path (and filename) and run svn commit. (It may be helpful to add some meaningful comments).

  2. If you need to simply get the latest version from an already committed version, then you need to run svn update on the file in your own workspace. This will repalce the file for you in your workspace.

Hope this helps.

Critical Skill