1

我们有一个大项目的资源。我和我的同事只处理这个项目中的几个文件,我们不想将它们全部置于版本控制之下。我和我的同事在我们的机器上拥有该项目的本地副本。我在执行命令的副本中修改并提交了几个文件:

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

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

4

2 回答 2

1

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

这样,您想要协同工作的所有文件都将可用,仅此而已。

于 2012-05-16T09:01:28.823 回答
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'.
于 2012-05-16T09:03:36.197 回答