您可以使用merge -r0..-1
命令执行此操作。但是如果你想把文件放到不同的子文件夹中,最好在合并之前这样做。
假设您有一个main
组件和2个子组件:foo
和bar
。您希望您的新的组合项目具有以下结构:
ProjectRoot/
main.txt <-- any files from main component
... should be at the root of the project
...
bar/ <-- bar subdirectory with files from bar component
foo/ <-- foo subdirectory with files from foo component
我们将合并foo
和bar
为main
。但是,首先让我们来移动文件到子目录:
cd /path/to/foo
bzr mkdir foo
bzr mv file1 file2 foo
bzr commit -m "files moved into foo/ subdirectory"
而且类似的bar
:
cd /path/to/bar
bzr mkdir bar
bzr mv file3 file4 bar
bzr commit -m "files moved into bar/ subdirectory"
现在,我们已经准备好要合并到一切main
:
cd /path/to/main
# ensure the working tree does not have uncommitted changes
bzr status
# now merge foo
bzr merge -r0..-1 /path/to/foo
# if there is no conflicts then you can commit this part
bzr status
bzr commit -m "merged foo component"
# now merge bar
bzr merge -r0..-1 /path/to/bar
# if there is no conflicts then you can commit this part
bzr status
bzr commit -m "merged bar component"
之后,你main
会合并了foo
和bar
。
你尝试过'bzr join'命令吗? – dOxxx 2012-03-24 13:37:34
是的,我尝试过。并击中这个错误/功能:https://bugs.launchpad.net/bzr/+bug/370710 – HRJ 2012-03-24 14:57:56
你在尝试升级之前运行“bzr加入”? – jelmer 2012-03-24 21:20:41