您可以使用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