SVN:如何与文件夹中的多个文件一起使用?

时间:2012-05-16 08:50:37

标签: svn

我们有一个大项目的来源。我和我的同事正在使用这个项目中的几个文件,我们不希望将它全部置于版本控制之下。 我和我的同事在我们的机器上有本地项目副本。我在我的副本执行命令中修改并提交了几个文件:

svn add --non-recursive folder1/folder2
svn add folder1/folder2/file1.txt
svn ci -m "Message"

之后,我的同事更新了他的项目并收到错误:

svn: Failed to add directory 'folder': an unversioned directory of the same name already exists

是否有可能以某种方式处理这个问题。我们不希望将整个项目置于版本控制之下。

2 个答案:

答案 0 :(得分:1)

您可以提交项目的主干,并让svn忽略您在版本控制下不需要的文件和文件夹。

这样,您希望协作工作的所有文件都可以使用,仅此而已。

答案 1 :(得分:1)

使用svn up --force。以下是svn up --help的引用:

If --force is used, unversioned obstructing paths in the working
copy do not automatically cause a failure if the update attempts to
add the same path.  If the obstructing path is the same type (file
or directory) as the corresponding path in the repository it becomes
versioned but its contents are left 'as-is' in the working copy.
This means that an obstructing directory's unversioned children may
also obstruct and become versioned.  For files, any content differences
between the obstruction and the repository are treated like a local
modification to the working copy.  All properties from the repository
are applied to the obstructing path.  Obstructing paths are reported
in the first column with code 'E'.