Documentation Command Line

Sublime Merge includes a command line tool, smerge, to work with repositories on the command line. This can be used to open repositories, search, and merge files.


Windows: Add C:\Program Files\Sublime Merge to your %PATH%

Mac: You'll want to add a symlink to smerge. Assuming you've placed Sublime Merge in the Applications folder, and that you have a ~/bin directory in your path, you can run:

ln -s "/Applications/Sublime" ~/bin/smerge

Linux: smerge should already be available by default. However, it won't be if you're using a tarball, so you'll want to add a symlink to sublime_merge named smerge:

ln -s /opt/sublime_merge/sublime_merge ~/bin/smerge


Run smerge --help:

Usage: smerge path               Open the given repository
             or: smerge search query       Search for commits in the current repository
             or: smerge blame file [line]  Blame the given file in the current repository
             or: smerge log file           Show the file history in the current repository
             or: smerge mergetool          Opens the merge tool for the given files
                   [--no-wait] [base] left right [-o merged]

            -n or --new-window:      Open a new window
            -b or --background:      Don't activate the application
            -h or --help:            Show help (this message) and exit
            -v or --version:         Show version and exit

Git Merge Tool Setup

The merge tool can be used to process merge conflicts within a Git repository from the command line.

After configuring smerge using the instructions above, run the following from the repository directory:

git config mergetool.smerge.cmd 'smerge mergetool "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED"'
git config mergetool.smerge.trustExitCode true
git config merge.tool smerge

Git Merge Tool Usage

To invoke the merge tool, run git mergetool