在 subversion 中标记当前版本
我在 SVN 中有多个分支,其中包含版本:
/branches/releaseApril
/branches/releaseMay
/branches/releaseJune
我想将当前生产中的版本标记为分支:
/branches/production
如果有人向 /branches/products 提交某些内容,我希望底层分支发生更改。就像 SVN 中的符号链接一样。这可能吗?
I have multiple branches in SVN, with releases in it:
/branches/releaseApril
/branches/releaseMay
/branches/releaseJune
I want to mark the release currently in production as a branch:
/branches/production
If somebody commits something to /branches/production, I want the underlying branch to change. Like a symlink in SVN. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 externals 完成类似的操作。但也有缺点。
You can accomplish something similar to this with externals. But there are drawbacks.
您可以在
branches
上的product
处将外部设置为^/branches/releaseJune
,但是当您签出branches 时将会看到该外部
。无法签出/branches/product
并开始使用它。您可以做的是在分支下有一个
生产
分支(基本上是分支下的生产
文件夹)并为其定义一个指向/branches/releaseJune 等并使用像
current
这样的文件夹。因此,当人们签出/branches/product
时,他们会得到一个文件夹current
,即/branches/releaseJune
另外,请确保在您更新外部文件时发布一个新版本以将其指向正确的分支。
You can set an external to
^/branches/releaseJune
atproduction
onbranches
, but that external will be seen when you checkoutbranches
. There is no way to checkout/branches/production
and start using it.What you can do is have a
production
branch under branches ( basically aproduction
folder under branches ) and define an external for it pointing to/branches/releaseJune
etc. and using a folder likecurrent
. So when people checkout/branches/production
they get a foldercurrent
which is/branches/releaseJune
Also, make sure you update the external when you do a new release to point it to the correct branch.
尝试
svn:external
。使用它可能会感觉很奇怪,但它应该可以满足您的需求。另一种选择是让分支
/branches/product
仅供所有人读取。这样,没有人可以意外地更改它,但这意味着人们必须切换到正确的分支(他们可能会使用错误的分支,所以你又回到了第一个方向)。Try
svn:external
. It might feel odd to use that but it should do what you want.Another option is to make the branch
/branches/production
read only for everyone. That way, no one can accidentally change it but it means people have to switch to the right branch (and they might use the wrong one, so you're back at square one).不,这是不可能的。您可以删除一个分支并创建一个具有相同名称的新分支,但不可能更新分支的“指针”以使其指向其他位置。
No, this is not possible. You can remove a branch and make a new branch with the same name, but it is not possible to update the "pointer" of a branch to make it point somewhere else.