如何重命名 CVS 中的分支?
如果您在 CVS 中错误地命名了分支,或者最初选择的名称变得不合适,如何将其更改为其他名称?
一个相关的问题是如何重命名分支在没有管理员访问权限的 CVS 中?。
If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else?
A related question is How do you rename a branch in CVS without admin access?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实现这一点的技巧是使用 CVS 中比较晦涩的管理命令之一 -N。 这是一个两个阶段的过程,有效地复制然后删除。
首先,您创建一个具有引用原始分支名称的正确名称的分支。 其次,删除原来的分支名称。
假设您有一个文件“File.txt”,当前分支为“bad
_
branch”。 您希望调用该分支 - 您能猜到吗? - “好_
分支”。要创建新的分支引用:
删除原始引用:
The trick to this is using one of CVSs' more obscure admin commands, -N. It is a two stage process, effectively copy then remove.
Firstly, you create a branch with the correct name that references the original branch name. Secondly, you delete the original branch name.
Assume you have a file "File.txt" that is currently branched "bad
_
branch". You'd like the branch to be called - can you guess? - "good_
branch".To create the new branch reference:
To delete the original reference:
由于我还无法向给定的答案添加注释(声誉较低),我想指出的是,先前答案中的给定命令缺少双引号!
更正:
As I cannot add comments to given answers yet (reputation to low), I want to remark that the given command in previous answer is missing double-quotes!
Correction:
如果您在“几个分支之前”犯了一个错误,则由于分支位置发生变化,admin -N 选项将不会有帮助。
该解决方案仅适用于对您的项目存储库的完全访问权限。
对我来说就像一个魅力。
抱歉,死灵,但我认为我的解决方案将帮助任何与我情况类似的人。
If you made a mistake "a few branches ago", admin -N option won't be helpful due to the branch position change.
This solution will work only with full access to repository of Your project.
Worked like a charm for me.
Sorry for necro, but I think that my solution will help anyone with situation similiar to mine.