Svn:如何签出某些目录并且仍然能够在根目录下更新
我在工作中有一个 SVN 项目,如下所示:
存储库
project |-- docs |-- scripts `-- app |-- trunk |-- branches | `-- development `-- tags |-- Release_1.0 |-- ... `-- Release_5.3
我希望我的工作文件夹如下所示:
工作副本
dir_root |-- docs |-- scripts |-- trunk `-- branches `-- development
我想从“dir_root/trunk”提交一些代码和“dir_root/docs”同时在一次提交中只有 1 个修订号。
我怎样才能签出以忽略“tags”文件夹并且仍然能够提交到多个目录。
注意:
- 我无法签出所有存储库,因为“标签”包含太多版本。
- 我尝试使用稀疏目录,但当我尝试提交时,它一直给我这个错误“svn:'/dir_root'不是工作副本”。
I have a SVN project at work that looks like this:
Repository
project |-- docs |-- scripts `-- app |-- trunk |-- branches | `-- development `-- tags |-- Release_1.0 |-- ... `-- Release_5.3
I want my working folder like this:
Working copy
dir_root |-- docs |-- scripts |-- trunk `-- branches `-- development
I would like to commit some code from "dir_root/trunk" and "dir_root/docs" simultaneously in one commit to have only 1 revision number.
How can I checkout to ignore the "tags" folder and still be able to commit to multiple directories.
Note:
- I can't checkout all the repository because "tags" contains too many release.
- I tried to use sparse directories, but it keep giving me this error "svn: '/dir_root' is not a working copy" when I try to commit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从错误来看,
dir_root
下的每个文件夹似乎都是单独签出的。因此dir_root
本身并不对应于SVN中的project
文件夹。您可以首先使用
--深度立即数
将project
检出到dir_root
中。这将在您的dir_root
中创建一个类似于 SVN 中的文件夹结构。之后,您可以更新您感兴趣的子文件夹(即docs
、trunk
等)。完成此操作后,您可以更改内容并从dir_root
进行一次提交,其中包含对dir_root/trunk
和dir_root/docs
的更改。From the error it looks like each of the folders under
dir_root
was checkout separately. Thusdir_root
itself does not correspond toproject
folder in SVN.You could start by checking out
project
with--depth immediates
intodir_root
. This will create a folder structure similar to the one in SVN in yourdir_root
. After this you can update the sub-folders you are interested in (i.e.docs
,trunk
, etc.). Once this is done, you can make changes to contents and do a single commit fromdir_root
which contain changes todir_root/trunk
anddir_root/docs
.使用 svn:externals 创建一个具有您提到的结构的目录将解决您的问题。
Creating a dir with svn:externals with the structure you have mentioned will solve your problem.