Merging Source Control Files—Git

There may be times when you need to merge changes from different authors when synchronizing or pulling files. The merge occurs automatically if there are no conflicting changes (i.e., changes do not occur in the same location in the file). If there are conflicting changes, a dialog opens, allowing you to determine how changes are merged.

How to Merge Source Control Files

  1. Synchronize your files with the remote repository. If your local copy of the file is different from the remote copy (e.g., another user has already pushed the same file to the remote), the Resolve Conflicts dialog opens. See Synchronizing Source Control Files—Git.
  2. Click Auto Merge All. If changes from the other user do not conflict with your changes, this will merge all changes. A message lets you know that a backup of your local copy has been made. This lets you restore that file if you do not want to keep the merged version. You do not need to complete the rest of the steps below.

    However, if your changes conflict with those from another user, a message displays to tell you. In this case, continue with the next step.

  3. Click OK on the conflict message.
  4. In the Resolve Conflicts dialog click Resolve. The Resolve Version Conflict dialog opens. From this dialog, you can choose from the following options.
    • Merge changes for me Automatically merges changes within the same file that are not part of the same element. If changes have been made to the same element (e.g., the same segment), Lingo will display a prompt to merge the changes using the merge tool.
    • Merge changes in merge tool Opens a merging interface, which lets you see exactly what changes were made and choose which to keep.
    • Undo my local changes Automatically removes your changes and keeps changes from other users.
    • Discard external changes Automatically removes changes from other users and keeps your changes.
  5. If you selected the option to use the merge tool, the Merge Changes dialog opens. Use this dialog to view and select changes. You can take actions in the following ways.
    • Click a change You can click a change on either the remote or local side. This lets you select a particular change. Use the key at the top of the merge changes dialog, as well as the color coding on the local and server sides, to determine if a change has been added (new), deleted, changed, or moved.

      When you select a change, the change you selected will display with a solid colored background, and the conflicting change will display with a striped background. If you select the other change, the background shading will switch.

    • Type content If you want to use your changes as well as those from another user, and even tweak the paragraph a bit more, you can click in the area at the bottom of the dialog and simply type content.
    • Previous/next conflict When you are finished resolving the first conflict, you can use the "Previous Conflict" and "Next Conflict" buttons at the bottom of the dialog to work on other conflicts in the file.
  6. After all conflicts have been resolved, a message lets you know that a backup of your local copy has been made. This lets you restore that file if you do not want to keep the merged version. Click OK.

Example  

Two translators—Bob and Jill—are working on the same project, using source control to manage the files.

Bob starts making changes to his local version of the "Jack and Jill" topic.

Jill also starts making changes to her local version of the topic. Jill's changes are in a different segment in the topic than Bob's changes; there are no conflicts. She finishes before Bob and synchronizes her files.

Bob finishes his changes and tries to synchronize his files. During the pull, Bob is prompted with a dialog, indicating that changes from another user have already been made.

Bob selects Auto Merge All. The changes from Bob and Jill are now both shown in the merged topic. When either translator pulls the topic again or synchronizes their files, they will see the new version of the topic.