SVN合并主干到分支删除文件
我正在尝试做一些看似简单但存在问题的事情。
基本上,我有一个 svn 存储库,它有一个主干和一个从修订版 122 创建的分支。
我向分支添加了一个文件 (src/utils/foo.py),将其提交为修订版 128,一切都很好。
但是,在我的分支中已经有几次提交(即(123,124,125,126,127)到我想要的主干中。所以我做了类似的事情:
$ svn merge -r122:127 ^/projects/my_project/trunk/src/utils .
--- Merging r123 through r127 into '.':
D foo.py
哎呀!它删除了我的文件!我做错了什么,这样就不会发生这种情况?
I am trying to do something seemingly simple, yet having problems.
Basically, I have an svn repo, it has a trunk and a branch which was created from revision 122.
I added a file (src/utils/foo.py) to the branch, committed it as revision 128, all good.
However, there have been several commits (namely (123,124,125,126,127) in to the trunk that I'd like in my branch. So I do something like:
$ svn merge -r122:127 ^/projects/my_project/trunk/src/utils .
--- Merging r123 through r127 into '.':
D foo.py
Whoops! It deleted my file! What am I doing wrong so that this doesn't happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它可能与拥有该文件的文件夹有关,而不是与文件本身有关。我相信大多数 SCM 工具都将文件夹视为文件,因为它们也会进行版本控制。您可能需要上一级以确保“utils”文件夹也被合并。
编辑:
再解释一下,文件夹“utils”记录了文件“foo.py”是它的子文件,因此即使foo.py存在于主干中,也不会合并更新的 utils 文件夹可能不会显示。
It may have more to do with the folder that owns the file, than the file itself. I believe most SCM tools treat folders like files in that they get versioned as well. You might need to go up one level to make sure that the "utils" folder gets merged over also.
Edit:
Just to explain a bit more, it is the folder "utils" that records that the file "foo.py" is a child of it, so even if foo.py exists in trunk, without merging the updated utils folder it may not display.
首先,您是否在执行 svn merge 命令的正确目录中?其次,永远不要只合并 SVN 中的子文件夹。 使用即可
只需在工作副本的根目录中 。这会更好,特别是与合并历史记录(svn:mergeinfo)相关。
First are you in the correct directory where you executed the svn merge command? Second never merge only subfolders in SVN. Just use
into the root of your working copy. That will be better in particular in relationship with the merge history (svn:mergeinfo).
啊!有人确实将分支合并到主干中,这将文件添加到主干中,但随后回滚了该提交,从主干中删除了该文件。感谢您的帮助。关于 svn merge 如何工作的好课。
Ah! Someone had indeed merged the branch into the trunk, which added the file to trunk, but then rolled back that commit, deleting the file from trunk. Thanks for the help. Good lesson in how svn merge works.