Next: , Previous: , Up: バージョンコントロールのブランチ   [Contents][Index]


30.1.11.3 ブランチのマージ

C-x v m

With a decentralized version control system, merge changes from another branch into the current one.

With a centralized version control system, merge changes from another branch into the current VC fileset.

While developing a branch, you may sometimes need to merge in changes that have already been made in another branch. This is not a trivial operation, as overlapping and conflicting changes may have been made to the two branches.

With a decentralized version control system, you merge changes with the command C-x v m (vc-merge). With Bazaar, this prompts for the exact arguments to pass to the bzr merge command, offering a sensible default if possible. With Git, this prompts for the name of a branch to merge from, with completion (based on the branch names known to the current repository). With Mercurial, this prompts for argument to pass to hg merge. The output from running the merge command is shown in a separate buffer.

With a centralized version control system like CVS, C-x v m prompts for a branch ID, or a pair of revision IDs (see ブランチ間の切り替え); then it finds the changes from that branch, or the changes between the two revisions you specified, and merges those changes into the current VC fileset. If you just type RET at the prompt, Emacs simply merges any changes that were made on the same branch since you checked the file out.

Immediately after performing a merge, only the working tree is modified, and you can review the changes produced by the merge with C-x v D and related commands (see 古いリビジョンの調査と比較). If the two branches contained overlapping changes, merging produces a conflict; a warning appears in the output of the merge command, and conflict markers are inserted into each affected work file, surrounding the two sets of conflicting changes. You must then resolve the conflict by editing the conflicted files; by default, Emacs will place buffers with VC conflicts in the special Smerge mode, which provides special commands for resolving the merge conflicts. Once you are done with resolving the conflicts and have saved the files with resolved conflicts, those files must be committed in the usual way for the merge to take effect (see バージョンコントロール下での基本的な編集).


Next: 新しいブランチの作成, Previous: ブランチへ/からの変更のpull/push, Up: バージョンコントロールのブランチ   [Contents][Index]

This page has generated for branch:master, commit:78a306c7ac6f4741f1d2a14332399d5f28e6a614 to check Japanese translation.