English | 日本語
Home > Merge > Merge for Windows > Documentation Contents > Merging Files

Merging Files

Merge provides a number of tools to enable you to quickly merge text files together to produce a file that can be saved. This article describes the merging process in detail.

In-place editing

As well as the merging operations described below, you can always fine-tune by editing text in-place. For more information, see Editing Files.

Merging buttons

There is a small merging push-button Merging button at the top-right corner of each block of changed lines.

Click on the merging button to make the lines replace the corresponding block of lines in the other file. To insert the block of lines after the lines in the other file, hold down the Ctrl key when you click. Similarly, you can insert the block of lines before the lines in the other file by holding down the Shift key when you click. To delete a block of lines, hold down Ctrl+Shift and click on the button. The icon displayed on the button will change when you press the Ctrl Append merging button, Shift Prepend merging button, or Ctrl+Shift Remove merging button keys.

When using merging buttons to copy lines from one file to another, or when inserting text into a file in any other way, Merge changes the line endings (CR and/or LF characters) in the lines copied to the predominant line endings found in the destination file. If this is not the behaviour you desire, you can specify different line endings when you save a file, as described in the topic Saving Files.

You can also use keyboard shortcuts to replace, insert and delete blocks of lines:

For a full list of keyboard shortcuts, see File Comparison Keyboard Shortcuts.

Fine-grained merging

The merging buttons and the commands in their context menus might not enable you to perform every type of merging. Use drag and drop text editing or the Copy Copy button and Paste Paste button commands to copy just part of a block of changed lines or to insert lines at an arbitrary location in another file.

Change blocks can be broken into individual lines using the Break changes into individual lines option in the Text Comparisons Display Options page.

When merging changes from one file into another, you may need to correct the indentation of the merged changes. Highlight the lines you want to adjust and press Ctrl+I or Ctrl+U keys to indent or unindent the block of highlighted lines. If the Tab key option is set, use you also use Tab and Shift+Tab to indent and unindent the highlighted lines, respectively.

Marking of changes

Every change that is made to a file is flagged with an edit marker Edit marker. If lines are introduced into a file, then a small arrow next to the edit marker (Left edit marker or Right edit marker) indicates the file from which the lines were copied. If lines are removed from the file, then a delete marker Delete edit marker is placed on the line after the position at which the lines were removed.

Each edit marker has an associated tool tip that explains why the edit was made. Hold the mouse cursor over the marker for a few seconds to see the tool tip. Conflict markers also have tool tips to explain the reason for the conflict.

You can navigate between edit markers using the Previous edit button and Next edit button buttons or the commands in the Markers section of the Edit menu.

Replacing the contents of one file with another

If you want to replace one file with the contents of another file, you can use the replace commands located on the toolbar. Simply click the Replace file to left button or Replace file to right button button in the ribbon or toolbar to replace the file to the left or right with the contents of the current file.

Automatic merging

Merge also supports automatic merging of two modified files into a common ancestor file. For more information about this type of merging, please see the Three-Way File Comparison and Merging and Automatic File Merging topics.