为什么我可以两次创建同一个 SVN 分支?
我可以创建同一个 SVN 分支两次。 我希望 SVN 不会允许我再次创建相同的分支。 请帮我解决这个问题。
I am able to create the same SVN branch twice. I would hope that SVN would not allow me to create same branch again. Please help me to fix this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 SVN 红皮书:
因此,当您创建分支“补丁”时,您的存储库中可以有多个目录“补丁”。
可能会让您感到困惑的是,当您在区分大小写的操作系统中使用不同的大小写(Patch 与 patch)在同一父目录“patch”中创建两次时。
为了更好地回答您的问题:
如果您确实想防止任何“与案例相关的路径冲突”,您可以设置一个预提交挂钩(这也是由 svn 副本触发),就像这个,来自 svn 工具 contrib
case-insensitive.py:
使用该钩子,您仍然可以创建多个具有相同名称的分支,但至少不能在同一父目录中,但大小写不同。
From SVN RedBook:
So when you create a branch 'patch', you can have several directories 'patch' within your repository.
What may confuse you is when you create in the same parent directory 'patch' twice, with a different case (Patch vs. patch), in a case-sensitive OS.
To better answer your question:
If you really want to prevent any "case-related path clash", you can set a pre-commit hook (which is also triggered by a svn copy), like this one, from svn tools contrib
case-insensitive.py:
With that hook, you can still create several branches with the same name, but at least not in the same parent directory, with a different case.
在 SVN 中,分支(以及标签)只是副本。
SVN 不知道分支是什么,它只知道副本。 SVN用户赋予这些副本以分支的含义,但这只是人们遵循的约定,而不是SVN遵循的约定。
In SVN, branches (and tags too) are only copies.
SVN has no idea of what a branch is, it only knows about copies. SVN users give to those copies the meaning of branches, but it's only a convention followed by the people, not by SVN.