Skip to content


SVN Update Dry Run

As a developer, when you are done with your code modification and you need to check the modification into the SVN repository, sometimes you may find that there are more recent version of the files you are modifying in the repository, especially when your project involves several developers. In this case, you may need to update your local copy to the latest version before checking those files in.

svn update .

The command above will update all files under the directory you are in. The trailing “dot” is required, and represents the current working copy you are currently in.

Sometimes, the update result can be surprising, as some of your modified local copies may have modified the same section as the most recent copies that you are trying to update with, thus it creates conflicts. You need to resolve the conflict by manually editing the conflicted files, or just simply accept any version of the files (working copy, or repository).

After sometime, I was wondering, if there is a way that I could know what would the update result be, that would be awesome! I will be able to know, which files are going to have conflict, and which files are safe to update.

After spending some time on searching, I found that this command could tell me what going to be the update result is:

svn merge --dry-run -r BASE:HEAD .

Specifying the revision BASE:HEAD will make the merge command behaves the same as the update command. It will show you what will be the result of the update command.

By using svn merge‘s --dry-run parameter, it will try the operation, without making any changes. So, no need to worry when a conflict happens. Just be prepared to resolve the conflict when you run the svn update command later.

No related posts.

Posted in SVN.

Tagged with , , , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.