svn で branch を trunk に merge する
1,ブランチがどのリビジョンから派生しているか確認する。
svn logに--stop-on-copyオプションを付けるとブランチがコピーされてから最新の修正までのログを表示する。
$ svn log --stop-on-copy -v http://svn.local/sample/branches/test ------------------------------------------------------------------------ r10 | svn | 2010-01-12 13:06:12 +0900 (火, 12 1月 2010) | 1 line 変更のあったパス: M /sample/branches/test/file.txt update first project. ------------------------------------------------------------------------ r8 | svn | 2010-01-12 13:03:13 +0900 (火, 12 1月 2010) | 2 lines 変更のあったパス: A /sample/branches/test (/sample/trunk:7 より) copy for first project ------------------------------------------------------------------------
上記だと、branches/testがリビジョン7から派生されてリビジョン10で変更されていることがわかる。
2.trunkへマージする
mergeコマンドに--dry-runオプションを使って影響を受けるファイルを確認。
"--dry-run"オプションを付けている場合、ローカルの作業エリアは、変更されない。
$ svn merge --dry-run -r 8:HEAD http://svn.local/sample/branches/test --- r9 から r11 までを '.' にマージしています: U file.txt
で今度は"--dry-run"を外して実際にマージする
$ svn merge -r 8:HEAD http://svn.local/sample/branches/test