Besides using PyCharm as an Integrated Development Environment, you can run use it as a command line tool for comparing and merging files. These can be any arbitrary files, but most often you need to compare and possibly 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.

In this topic:

  1. Enable invoking PyCharm operations from the command line.
  2. Type the following command at the command line prompt:
    <PyCharm launcher> diff <path to file1%gt; <path to file2> <path to file3>
                         
    where file1 is your local copy, file2 is the repository version, and file3 is the base revision for file1 and file2 (optional).
    1. If you have specified the location of the PyCharm executable as a Path environment variable, the command will work no matter which directory you are currently in. Otherwise, you need to switch to the PyCharm installation folder first or specify the full path to the executable.
    2. PyCharm executable is platform-dependent: PyCharm.exe or %product.bat for Windows, PyCharm.sh for Linux.
  1. Enable invoking PyCharm operations from the command line.
  2. Type the following command at the command line prompt:
                    <PyCharm launcher> merge <path to file1%gt; <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).

See Also

Procedures:

Reference:

Web Resources: