AppCode 2017.1 Help

Running AppCode as a Diff or Merge Command Line Tool

In this topic:

Overview

Besides using AppCode as an Integrated Development Environment, you can use it as a command line tool for comparing and merging files.

Comparing files using AppCode as a command line tool

To compare two files using AppCode as a diff command line tool

  1. Enable invoking AppCode operations from the command line.
  2. Type the following command at the command line prompt:
    <AppCode launcher(Windows) or wrapper script (MacOS or UNIX)> diff <path to file1> <path to file2>
    where file1 is your local copy, file2 is the repository version.

For example:

diff README.md.bak README.md

Merging files using AppCode as a command line tool

Most often you need to merge three versions of the same file: your local version, the version in the repository or in the upstream, and the base revision, which is the origin for the two diverged versions.

To merge files using AppCode as a command line tool

  1. Enable invoking AppCode operations from the command line.
  2. Type the following command at the command line prompt:
    <AppCode launcher(Windows) or wrapper script (MacOS or UNIX)> merge <path to file1> <path to file2> <path to file3> <path to output>
    where file1 is your local copy, file2 is the repository version, file3 is the base revision for file1 and file2, and output is the file to save the merge results in (optional).

Passing three arguments to merge tool

It is possible to pass just three arguments to the merge tool:

<path to file1> <path to file2> <path to output>.

In this case, the contents of the output will be taken as the base revision:

<AppCode launcher> merge <path to file1> <path to file2> <path to output> <path to output>

See the example in this blog to learn how to use AppCode diff and merge tool with Git.

See Also

Last modified: 26 July 2017