假设我有一个 svn
目录和本地目录。如果我 svn co
进入本地目录,正好有同名文件,有没有覆盖本地文件的风险?
最佳答案
如果您查看 svn checkout 的文档, 它说:
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.
简而言之:
--force
您遇到必须解决的冲突 --force
如果文件不同,您可以进行修改 关于svn - svn checkout 是否覆盖现有的本地文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22662961/