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.
Add C:\Program Files\Sublime Merge
to your environment %PATH%
variable.
You'll want to add a symlink (symbolic link) 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 Merge.app/Contents/SharedSupport/bin/smerge" ~/bin/smerge
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
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
To invoke the merge tool, run:
git mergetool
Reference Sublime Merge Command Line Documentation