P4merge Sourcetree

broken image


Merge for macOS integrates with most version control (VC), software configuration management (SCM) and other applications that allow a third-party file comparison (diff) or file merging tool to be specified. This page contains instructions for integrating Merge with the following applications:

Integration with many SCM systems requires the Professional Edition of Merge to enable the comparison of two modified versions of a file with their common ancestor.

Other applications

If your chosen application isn't listed on this page, you may find the information for integrating Merge for Windows with other applications to be a helpful starting point. You may also be able to integrate Merge with another application yourself, using the Merge AppleScript API or command-line utility.

If you have instructions for integrating Merge with other systems, or corrections to the information presented below, please contact us to let us know so that we can update this list.

AccuRev

  • That avoids the trouble-causing spaces in the path and plays nice with Sourcetree. It's hackish, but it works. You can then use something like this as the path to Meld: C: Progra1 Meld meld.exe It may not be guaranteed that Progra1 maps to the 64-bit directory, so you might need to experiment with which one maps to which.
  • Get SourceTree to accept p4Merge as its merge/diff tool, and Be able to actually call p4Merge from SourceTree to resolve conflicts. So far the only thing I've been successful at doing is getting P4Merge to display a diff from within SourceTree.

The AccuRev macOS client can be configured to use Araxis Merge for file comparison and merge operations.

Git lets you use any visual diff/merge tool (like opendiff shipped with sourcetree or p4merge, the one that I will use) with the git difftool or git mergetool. Install & config p4merge. Set up SourceTree Open a terminal using SourceTree; Disable autoCRLF Copy-paste this command into the terminal: git config -global core.autoCRLF false; Set up your personal Git account Tools Options General; Set up Default User Information as appropriate; Set up P4Merge Tools Options Diff; External Diff Tool Merge Tool select P4Merge.

These steps are believed to work with AccuRev 5.2.

To configure the AccuRev client to use Merge for file comparison:
  • In the AccuRev client, choose Preferences… from the Tools menu.

  • Select the Diff/Merge tab.

  • In the Diff entry field, enter the following:

  • Close the Preferences window.

To configure the AccuRev client to use Merge for file merging:
  • The Araxis Merge compare utility cannot be used directly for file merging by the AccuRev client, which passes quoted filenames and expects a particular return code on success. To work around this, create a file ac-merge-shim.sh in /usr/local/bin/ (or another location of your choosing) with the following content:

  • Make the ac-merge-shim.sh script executable. For example, run the following command in the macOS Terminal (replacing /usr/local/bin with the full path to the shim file as necessary):

  • In the AccuRev client, choose Preferences… from the Tools menu.

  • Select the Diff/Merge tab.

  • In the Merge entry field, enter the following:

    Note: If necessary, replace the instance of /usr/local/bin/ with the full path to the ac-merge-shim.sh script.

  • Close the Preferences window.

Cornerstone

Zennaware Cornerstone is a Subversion client that has built-in support for Merge. The following instructions have been tested with Cornerstone v2.7.9.

To configure Cornerstone to use Merge:
  • Choose CornerstonePreferences…
  • Select the General category.
  • Click the External compare tool drop-down field and choose Araxis Merge.
  • Click the External merge tool drop-down field and choose Araxis Merge.
  • Close the Preferences window.

Dreamweaver

Adobe (Macromedia) Dreamweaver CS6 integrates with Araxis Merge and can launch a two-way file comparison. Consequently, the Standard Edition of Merge is sufficient if you will be using it only with Dreamweaver.

The following instructions have been tested with Dreamweaver CS6 v12.0.

To configure Dreamweaver CS6 to use Merge as the file comparison tool:
  • Choose DreamweaverPreferences…

  • Select the File Compare category.

  • In the Choose application to compare files field, enter the following:

  • Click OK to dismiss the Preferences dialog.

Eclipse

For Eclipse, see the entry for Subclipse.

Git

Merge integrates tightly with Git. Araxis provides a Git File System Plugin to enable Merge to access files in Git depots directly. For file comparisons (but not folder comparisons), Merge is also able to populate the Versions button drop-down versions menu with other revisions of each file being compared. For more information, see Comparing Text Files (or Typed/Pasted Text).

Git can also be configured to use Merge for file comparison and merge operations.

The following configuration steps have been tested with Git v2.24.0.

To use Araxis Merge for file comparison and file merging:
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Update the Git configuration file by adding the following diff and merge tool configurations:

  • To compare files, use the git difftool command. To resolve conflicting changes after merging files from a branch or remote repository, use git mergetool.

  • As of Git v1.7.11, the git difftool command can be run with the --dir-diff option. This will open a folder comparison showing all the changed files.

  • The git ad (short for Araxis diff) and ads (Araxis diff stage) aliases defined above provide convenient shortcuts to invoke Merge via the git difftool command. See below for example usage.

Examples of using the git ad and ads aliases:

The git difftool command is a frontend to git diff and thus accepts git diff options and arguments. As the Git ad and ads aliases defined in the above configuration are simply shortcuts for invoking git difftool, this means that you can in general pass git diff arguments to git ad and git ads. The examples below show some possibilities, but are by no means exhaustive.

The documentation on specifying Git revisions and ranges may also be helpful when considering how best to invoke git ad.

  • Launch a two-way folder comparison to show all the unstaged changes within the current working tree:

  • Launch a two-way folder comparison to show all the staged changes within the current index (staging area):

  • Launch a two-way folder comparison showing the changes to a modified file myfile.c:

  • Launch a two-way folder comparison of commits 11a783 and c2061b of myfile.c:

  • Launch a two-way folder comparison to show all the changes applied by the commit with hash c2061b:

    If you are using zsh as your shell and have the EXTENDEDGLOB option set, you will need to escape the ^:

  • Launch a two-way folder comparison to show all the changes between the master and bugfix branches:

IntelliJ IDEA/PhpStorm

IntelliJ IDEA and PhpStorm can be configured to use Merge for file and folder comparisons, and also for file merging. The following steps have been tested with IntelliJ IDEA 2020.2.

To configure IntelliJ IDEA/PhpStorm to use Merge as the file and folder comparison tool:
  • Choose IntelliJ IDEA/PhpStormPreferences…

  • Select ToolsDiff & MergeExternal Diff Tools in the list on the left side of the Preferences window.

  • Check the Enable external diff tool checkbox. In the accompanying Path to executable field, enter the following:

  • Ensure the following is entered in the Parameters field:

  • Check the User by default checkbox to use Merge for comparison of files and folders by default.

To configure IntelliJ IDEA/PhpStorm to use Merge as the merging tool:
  • Choose IntelliJ IDEA/PhpStormPreferences…

  • Select ToolsDiff & MergeExternal Diff Tools in the list on the left side of the Preferences window.

  • Check the Enable external merge tool checkbox. In the accompanying Path to executable field, enter the following:

  • Enter the following in the Parameters field:

  • Uncheck the Trust process exit code checkbox. The exit code from compare does not indicate the output file has been updated.

If Merge is used to make changes to a file that IntelliJ IDEA/PhpStore has stored in memory, perhaps following a merge operation, IntelliJ IDEA/PhpStorm may ask whether you wish to keep the file it has in memory or update it with the contents of the modified file on disk. It is most likely you will want to load changes from disk following a merging operation.

MacHg

MacHg is a fully featured free Mercurial client for macOS. MacHg provides built-in support for Araxis Merge.

The following instructions have been tested with MacHg v0.9.25.

To configure MacHg to use Merge:
  • Open the MacHg Preferences window.
  • Select the Mercurial page.
  • In the Merge and Diff Tool section, choose AraxisMerge for both the For Diffs use and For Merges use fields.

Mercurial

Merge integrates tightly with Mercurial. Araxis provides a Mercurial File System Plugin to enable Merge to access files in Mercurial depots directly. Merge is also able to populate the Versions button drop-down versions menu with other revisions of each file being compared. For more information, see Comparing Text Files (or Typed/Pasted Text).

Mercurial can also be configured to use Merge for file/folder comparison and file merge operations. The comparison integration uses the Extdiff extension, which is supplied with Mercurial.

The following instructions have been tested with Mercurial v1.8.4.

Sourcetree P4merge Tool

To configure Mercurial to use Araxis Merge for file merging:
Sourcetree
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Update the appropriate Mercurial configuration file to add the following merge tool configuration:

To configure Mercurial to use Araxis Merge for file comparison:
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Update the appropriate Mercurial configuration file to create a new hg sub-command, arxdiff:

    The -wait argument to the compare utility is required to enable file comparisons to be recompared as a different type (text, binary or image) from within Merge and, in the case when Mercurial launches a folder comparison, to enable file comparisons to be launched from that folder comparison.

Examples of using hg arxdiff:
  • Launch a two-way file comparison showing the changes to a modified file myfile.c:

  • Launch a two-way file comparison of revisions 1 and 2 of myfile.c:

  • Launch a two-way file or folder comparison (as appropriate, depending upon the number of files modified) to show all the changes within the current working directory:

  • Launch a two-way file or folder comparison (as appropriate, depending upon the number of files modified) to show all the changes applied by the changeset with id 0bc544fad9e6:

Path Finder

Path Finder can be configured to use Araxis Merge for file comparison. Allowing the launching of Merge from Path Finder's Compare… context menu when two files are selected.

The following instructions have been tested with Path Finder 7.

To configure Path Finder to use Merge for file comparison:
  • In Path Finder, choose Preferences… from the Path Finder menu.

  • Select the Features tab.

  • Select the File Comparison item.

  • Click the Select tool… button.

  • Navigate to and select:

  • Click the Choose tool button.

  • Close the Preferences window.

    Click 'Install' When asked if you'd like to allow SourceTree to make changes to your computer, click 'Yes' Click 'Finish' Agree to the license agreement; Choose whether or not you want to 'Help improve SourceTree' Allow SourceTree to 'Configure automatic line ending handling'. Source tree installation tutorial. Sourcetree allows you to search for and clone remote repositories within its simple user interface. Sourcetree for Windows Enterprise Install, update, and manage Sourcetree at scale in your managed enterprise environment. Install and set up Sourcetree. Install Sourcetree. Step-by-step instructions for installation. Connect your Bitbucket or Github account. If you want to add remote repositories, you need to connect to your hosting service. Clone a remote repository.

Perforce

Merge integrates tightly with Perforce. Araxis provides a Perforce File System Plugin to enable Merge to browse Perforce depots directly. This means that, for example, you can compare branches of source code directly within a depot without syncing them to the client workspace. Merge is also able to populate the Versions button drop-down versions menu with other revisions of each file being compared. For more information, see Comparing Text Files (or Typed/Pasted Text).

To browse Perforce repositories directly from Merge:
  • See the instructions on the Perforce File System Plugin page.
To configure P4V (2007.2 release or later) to use Merge for file comparison and merging:
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Choose Preferences… from the P4V menu.

  • Select the Diff tab.

  • Select the Other application radio button (or Use external application in older versions of P4V).

  • For the Location field, enter the following:

  • Ensure that the Arguments field reads %1 %2. This step can be ignored for older versions of P4V, which do not have this field.

  • Select the Merge tab.

  • Select the Other application radio button (or Use external application in older versions of P4V).

  • For the Location field, enter the following:

  • Ensure that the Arguments field reads %b %1 %2 %r. This step can be ignored for older versions of P4V, which do not have this field.

  • Click the OK button to dismiss the Preferences dialog.

  • P4V should now open Merge for its comparison and interactive merging operations.

To configure the Perforce command-line tool (p4) to use Merge:
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Set the P4DIFF environment variable to the full path of the araxisp4diff utility. Also, set the P4MERGE environment variable to the full path to araxisp4winmrg.

    Add the following to your .bash_profile:

  • When you open a new command shell, Merge should now be invoked as appropriate by the Perforce command-line tools. For example,

    will open up a two-way comparison for each of the files that you have opened for edit (including any binary or image files) in your default changelist.

SmartGit/Hg

SmartGit/Hg can be configured to use Araxis Merge for file comparison and merge operations.

To configure SmartGit/Hg to use Araxis Merge for file comparison:
  • Choose Preferences… from the SmartGit/Hg menu.

  • Expand Tools in the tree on the left.

  • Select Diff Tools in the tree on the left.

  • Select the * pattern in the table and click the Edit… button.

  • Select the External diff tool radio button.

  • In the Command entry field, enter the following:

  • In the Arguments entry field, enter the following:

  • Click OK to apply the changes and exit the Edit dialog.

To configure SmartGit/Hg to use Araxis Merge for file merging:
  • Choose Preferences… from the SmartGit/Hg menu.

  • Expand Tools in the tree on the left.

  • Select Conflict Solver in the tree on the left.

  • Select the External Conflict Solver radio button.

  • In the Command entry field, enter the following:

  • In the Arguments entry field, enter the following:

  • Click OK to apply the changes and exit the Preferences dialog.

SmartSVN/SmartCVS

SmartSVN and SmartCVS clients can be configured to use Araxis Merge for file comparison and merge operations.

Note that the ability to use an external tool for solving conflicts is not available in the Foundation version of SmartCVS.

The following instructions have been tested with SmartSVN v7.5.4.

To configure SmartSVN/SmartCVS to use Araxis Merge for file comparison:
  • Choose Preferences… from the SmartSVN or SmartCVS menu.

  • War thunder register bonus. Select File Compare in the tree on the left (File Comparators in SmartCVS).

  • Select the * pattern in the table and click the Edit… button.

  • Select the External Comparator radio button.

  • In the Command entry field, enter the following:

  • In the Arguments entry field, enter the following:

  • Click OK to apply the changes and exit the Edit dialog.

To configure SmartSVN/SmartCVS to use Araxis Merge for file merging:
  • Choose Preferences… from the SmartSVN or SmartCVS menu.

  • Select Conflict Solver under Actions in the tree on the left.

  • Select the External Conflict Solver radio button.

  • In the Command entry field, enter the following:

  • In the Arguments entry field, enter the following:

    Note: The '${baseFile}' template is not required when using SmartCVS.

  • Click OK to apply the changes and exit the Preferences dialog.

SourceTree

Atlassian SourceTree is a client for Git and Mercurial. The following instructions have been tested with SourceTree v1.6.0.

To configure SourceTree to use Merge for comparing files:
  • Open the SourceTree Preferences dialog and choose the Diff tab.

  • Select Araxis Merge as the Visual Diff Tool.

To configure SourceTree to use Merge for merging files:
  • Open the SourceTree Preferences dialog and choose the Diff tab.

  • Select Araxis Merge as the Merge Tool.

Subclipse

Subclipse is an Eclipse plugin providing support for Subversion within the Eclipse IDE. It can be configured to use Merge as its merging tool. Merge will then be used whenever you choose Edit Conflicts from a Team menu in Eclipse.

Merge can also integrate directly with Subversion. Please see Subversion section for more information.

The following steps have been tested with Subclipse v1.8.18, Eclipse v4.2.1 and Subversion v1.6.18

To configure Merge as the Subclipse file merging tool:
  • Ensure that the command-line utilities have been installed as described in the Installing the Merge command-line utilities section of the How to Install page.

  • Unfortunately, the compare utility cannot be used directly to launch Merge, since Subclipse does not appropriately divide the user-specified list of external conflict program parameters. It is therefore necessary to create a shell script that will divide the list of parameters appropriately.

    Create a file /usr/local/bin/subclipse-shim.sh with the following content:

  • In the Eclipse Preferences window, select the TeamSVNDiff/Merge page.

  • Select the External radio button.

  • In the adjacent entry field, enter the following:

  • In the Parameters field, enter the following:

  • Click the Apply button.

Subversion

Merge integrates well with Subversion. Araxis provides a Subversion File System Plugin to enable Merge to browse Subversion repositories directly. This means that, for example, you can compare branches of source code directly within a repository without syncing them to the client workspace. Merge is also able to populate the Versions button drop-down versions menu with other revisions of each file being compared. For more information, see Comparing Text Files (or Typed/Pasted Text).

See also the entries for Subversive, svnX and Subclipse.

To browse Subversion repositories directly from Merge:
  • See the instructions on the Subversion File System Plugin page.
To configure the Subversion command-line tool (svn) to use Merge:

The following instructions have been tested with Subversion v1.6.18 and v1.7.8.

  • Open your ‘SVN configuration area' configuration file in a text editor. The default location for this file is ~/.subversion.

  • Uncomment the line that specifies the diff-cmd and set its value to the path of the Merge araxissvndiff executable that you have installed on your machine:

  • The Subversion command-line client versions 1.5 and later can be configured to merge non-conflicting changes automatically, but to launch Merge interactively to resolve conflicting changes.

    If you wish to have Subversion merge non-conflicting changes itself, and use Merge only for conflicting changes, add a merge-tool-cmd line to set the path of the Merge araxissvnmerge executable:

    The merge-tool-cmd option is ignored when the value of the diff3-cmd option is defined. Ensure that the value of the diff3-cmd option has not been defined.

  • Alternatively, if you would rather use Merge to resolve all changes, you can define the diff3-cmd configuration option instead of merge-tool-cmd. (Note that diff3-cmd is the only option for Subversion versions prior to v1.5.)

    If defined, diff3-cmd should be set to the path of the Merge araxissvndiff3 command-line utility:

  • Save the modified configuration file and exit the text editor.

  • Merge will now be launched when performing Subversion commands (e.g. svn diff, svn update and svn merge) that require a two or three-way comparison.

Subversive

Subversive, the official Eclipse plugin can be configured to use Merge as its merging tool. It provides support for Subversion within the Eclipse IDE. Merge will then be used for file comparisons, and for merging whenever you choose Edit Conflicts from a Team menu in Eclipse.

Merge can also integrate directly with Subversion. Please see Subversion section for more information.

The following steps have been tested with Subversive v1.0.0, Eclipse v4.2.1 and Subversion v1.6.18

To configure Merge as the Subversive file comparison and merging tool:
  • Unfortunately, the compare utility cannot be used directly to launch Merge, since Subversive does not divide the user-specified lists of program arguments appropriately. It is therefore necessary to create a shell script to do this.

    Create a new shell script /usr/local/bin/subversive-shim.sh with the following content:

  • To configure Subversive to use an external tool for file comparisons, the user specifies the location of the tool and a list of arguments that are to be sent to it. When configuring this list of arguments, the tokens ${mine}, ${base} and ${theirs} are used to represent the location of the files to be compared. When a file comparison is invoked, tokens in the list of arguments are replaced with paths to the files to be compared. Unfortunately, Subversive is inconsistent in which tokens it replaces with paths, depending on how the file comparison is invoked in Eclipse. The remote file is sometimes passed using ${base} and at other times ${theirs}. Fortunately, when ${base} is used, ${theirs} is replaced with no text, and it is therefore possible to create a script that will launch Merge using the paths from ${mine} and ${theirs}, unless ${theirs} is empty text, in which case the paths in ${mine} and ${base} are compared instead.

    Create a file /usr/local/bin/araxissubversivediff.osa with the following content:

  • In the Eclipse Preferences window, select the TeamSVNDiff Viewer page.

  • Click the Add… button.

  • In the Extension or mime-type field, enter the following:

  • Within the Diff program arguments box, enter the following into the Program Path field:

  • In the larger field beneath, enter the following:

  • Within the Merge program arguments box, enter the following into the Program Path field:

  • In the larger field beneath, enter the following:

  • Click the OK button.

  • Review the new settings in the Diff Viewer table.

  • Click the Apply button.

Surround SCM

Surround SCM has built-in support for Araxis Merge. To set Araxis Merge as the default application for file comparison and merging:

  • Choose User Options… from the Tools menu.
  • Select the Diff/Merge tab.
  • Edit the settings for a selected file type.
  • Select Araxis Merge from the comparison application drop-down list.

Please see the Surround SCM website for more details.

svnX

svnX is an open source GUI for most features of the Subversion client. It has built-in support for Merge.

To configure svnX to use Merge:
  • Choose Araxis Merge as the Diff application in the svnX Preferences window.
  • Please be sure to read the svnX online help for information about setting-up svnX to work with Merge. At the time of writing, svnX requires the araxissvndiff command to be installed in a particular location. The command can be copied from the /Applications/Araxis Merge.app/Contents/Utiltities folder to the required location.

TortoiseHg

TortoiseHg can be configured to use Araxis Merge for file comparison and merge operations.

To configure TortoiseHg to use Araxis Merge for file comparison:
  • Configure Mercurial to use Araxis Merge for file comparison, as described in the Mercurial section.

  • Choose Preferences from the TortoiseHg menu.

  • Select TortoiseHg in the list on the left.

  • In the Visual Diff Tool drop-down field, choose arxdiff.

  • Click OK to apply the changes and close the TortoiseHg Settings window.

To configure TortoiseHg to use Araxis Merge for file merging:
  • Configure Mercurial to use Araxis Merge for file merging, as described in the Mercurial section.

  • Choose Preferences from the TortoiseHg menu.

  • Select TortoiseHg in the list on the left.

  • In the Three-way Merge Tool drop-down field, choose araxismergetool.

  • Click OK to apply the changes and close the TortoiseHg Settings window.

Tower

Tower is a client for Git that can be easily configured to use Araxis Merge as its preferred comparison and merging tool. The following instructions have been tested with Tower v1.5.0.

To configure Tower to use Merge:
  • Open Tower's Preferences window.
  • Select the Git Config tab.
  • Choose Araxis Merge in the Preferred Diff Tool and Preferred Merge Tool drop-downs.

Veracity

Veracity is an Open Source, distributed version control and bug tracking system for Windows, macOS, and Linux. SourceGear, the company behind Veracity, has helpfully provided the information here.

Veracity supports Araxis Merge out of the box for both diff and merge operations. Simply use --tool araxis with any command that supports external comparison or merging tools. Alternatively, you can configure Merge as your default tool for various operations as described below.

For support using Veracity with Araxis Merge, please see http://veracity-scm.com/qa.

To make Araxis Merge the default interactive comparison tool for text files:
To make Araxis Merge the default interactive comparison tool for binary files:
To make Araxis Merge the default interactive merging tool for text files:
To make Araxis Merge the default interactive merging tool for binary files:

Versions

The Versions client for Subversion can be easily configured to use Araxis Merge. The following instructions have been tested with Versions v1.2.2.

P4merge Sourcetree Not Opening

To configure Merge as the Versions comparison tool:
  • Open the Preferences window within Versions.
  • Choose Araxis Merge from the File Comparison drop-down field.

P4merge Sourcetree Setup

To add your supply request file, do the following:

  1. From your BitbucketStationSupplies in Bitbucket, click Source to open the source directory. Notice you only have one file, supplies.txt, in your directory.

    • A. Source page: Click the link to open this page.

    • B. Branch selection: Pick the branch you want to view.

    • C. More options button: Click to open a menu with more options, such as 'Add file'.

    • D. Source file area: View the directory of files in Bitbucket.

  2. From the Source page, click the More options button in the top right corner and select Add file from the menu. The More options button only appears after you have added at least one file to the repository. A page for creating the new file opens, as shown in the following image.

    • A. Branch with new file: Change if you want to add file to a different branch.

    • B. New file area: Add content for your new file here.

  3. Enter supplyrequest in the filename field.

  4. Select HTML from the Syntax mode list.

  5. Add the following HTML code to the text area:

    We are requesting additional supplies. Please send us the following:



    • space ice cream

    • nerf darts

    • telescope light shield

  6. Click Commit. The Commit message field appears with the message: supplyrequest created online with Bitbucket.

  7. Click Commit under the message field.





broken image