Create symlink
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Add below path to your .bash_profile or .bashrc
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
runs below for immediate command:
source ~/.bashrc or ~/.bash_profile