Skip to content

Instantly share code, notes, and snippets.

@SuryaElite
Created September 23, 2018 09:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save SuryaElite/58ff27c474accd31dbd91545ee0d3620 to your computer and use it in GitHub Desktop.
Save SuryaElite/58ff27c474accd31dbd91545ee0d3620 to your computer and use it in GitHub Desktop.
Launch Sublime Merge from the command line on OSX

Launch Sublime Merge from the command line on OSX

Sublime Merge includes a command line tool, smerge, to work with git, subversion, mercurial projects on the command line. This can be used to open projects in Sublime Merge using the command line.

Requirements

  • Sublime Merge installed in your system within Applications folder

Setup

In order to launch sublime from command line you only need to create a symlink /usr/local/bin/smerge point to sublime merge app, to do so run the following in the command line.

Sublime Merge

ln -sv "/Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge" /usr/local/bin/smerge

You can use any name whlie creating the symlink like /usr/local/bin/sm

Test it out

type in command line

smerge myGitProject

it should open the project using Sublime Merge


NOTE: To accomplish this you must:

have created a directory where you actually place binaries /usr/local/bin if not make it before creating a symlink:

mkdir -p /usr/local/bin

have /usr/local/bin in your PATH environment variable, if not add by running the following command:

echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile

then reload the shell:

source ~/.bash_profile

test again.

Further info read from Sublime Merge Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment