Does svn checkout overwrite existing local files?
Asked Answered
F

1

6

Suppose I have a svn directory and a local directory. If I svn co into the local directory, and there happens to be files with the identical name, is there any risk that I will overwrite the local files?

Fugacious answered 26/3, 2014 at 13:47 Comment(0)
E
7

If you look at the documentation for svn checkout, it says:

Prior to version 1.7, Subversion would complain by default if you try to check out a directory atop an existing directory which contains files or subdirectories that the checkout itself would have created. Subversion 1.7 handles this situation differently, allowing the checkout to proceed but marking any obstructing objects as tree conflicts. Use the --force option to override this safeguard. 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. If those contents differ from the repository file at that path (which was downloaded as part of the checkout), the file will appear to have local modifications—the changes required to transform the versioned file you checked out into the unversioned file you had before checking out—when the checkout completes.

In short:

  • without --force you get a conflict you must resolve
  • with --force you have modifications to commit if the files are different
Electrodialysis answered 26/3, 2014 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.