Resolve Conflicts Using the Git Panel

Use the Git Panel to review and resolve conflicts that occur when your changes clash with those made by other project members.

Conflicts usually occur when you and your teammate change the same line in different ways, or if one of you deleted a file while the other modified it. In such cases, VB Studio cannot tell which version is correct—it's up to you or your teammate to make that decision and resolve the conflict.

Note:

To help minimize the number of conflicts, the best practice is to make sure your local branch and the remote branch are in sync and up-to-date. You do this by frequently pulling commits on the remote branch to your local branch and by pushing changes from your workspace to the remote branch.

You'll be informed of conflicts when you attempt to merge or pull commits into your workspace. For example, let's say you've changed lines 2 and 3 in readme.md and committed the changes to a local branch in your Git repo. Now if someone else modified the same lines in readme.md and committed the changes to a remote branch, you'll be warned of conflicts between the file's remote version and your local version when you do a pull request to refresh your workspace, as shown here:
Description of showconflicts.png follows
Description of the illustration showconflicts.png

When this happens, here's what to do:

  1. Click Show Conflicts to open the Git Panel and view the files identified as containing conflicts:

    If you don't want to continue the operation, click Abort in the Git Panel to return your local repo to its previous state (the last commit made to the branch, known as HEAD)—but you won't be able to refresh your workspace until you abandon your local changes or resolve the conflicts.
  2. To resolve conflicts and continue your operation, right-click the file listed under Conflicts in the Git Panel and take action.

    The options that show depend on the type of conflict in the file. Here's an example of what you see when people make different changes to the same line of the same file (readme.md):
    Description of gitpanel-conflict-filecontextmenu.png follows
    Description of the illustration gitpanel-conflict-filecontextmenu.png

    Action Steps
    Open in conflict editor Select this option to open the file in the conflict editor; you can also just click the file to open it in the conflict editor. The conflict editor has controls to help you navigate between conflicts and provides options to resolve them. See Use the Conflict Editor to Resolve Conflicts.
    Open in default editor

    Select this option to open the file in the default editor, which are the designated artifact editors in VB Studio (for example, the Page Designer for an .HTML file or the JavaScript editor for a .JS file). This option is useful for non-text files (such as Excel worksheets and schema files) or other artifacts that aren't supported in the conflict editor. You can then open these files in the default editor and manually resolve the conflicts.

    Resolve Select this option to quickly resolve the file's conflicts, instead of going through each conflict in the conflict editor. This option is useful when the file has only a few conflicts that you can easily resolve by selecting either your version or the other version. See Use the Context Menu to Resolve Conflicts.

    Note:

    Resolve is not an option for non-text files. If you run into conflicts for binary files (say, an image file), you'll need to delete the file from the Git repo, then add it again after you've resolved all other conflicts and committed them to the remote repo.
    Delete Select this option to delete the file from the Git repo.

    It's also possible to review and resolve merge conflicts from VB Studio’s Git page. See Resolve a Merge Conflict.

  3. When you have many files with conflicts, you'll need to right-click each file in the Git Panel and take action.
  4. Once all the conflicts are resolved, click Continue in the Git Panel (or header menu) to continue your interrupted pull or merge operation.
  5. Remember to push your changes to the remote repo.