Forked from geekmanager/make-git-use-sublime.markdown
Created
February 7, 2018 17:53
-
-
Save mTresk/6334991ba7e657e7583b09589f4bd613 to your computer and use it in GitHub Desktop.
Revisions
-
geekmanager revised this gist
Mar 20, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Making git use Sublime Text First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to `subl` which is the launcher from terminal: `ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime` -
geekmanager revised this gist
Mar 20, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ First up, let's make Sublime Text 2 available from the command line in terminal, If there's any chance that `bash` doesn't check `usr/local/bin` then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen. Now tell git to use `sublime`: `git config --global core.editor "sublime -n -w"` (the -n = new window; -w = wait for file to be closed before returning. If you don't use the latter option, Sublime doesn't actually let you _edit_ before returning to the in process `git rebase` or similar.) -
geekmanager renamed this gist
Mar 20, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
geekmanager created this gist
Mar 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to `subl` which is the launcher from terminal: `ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime` (added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink). If there's any chance that `bash` doesn't check `usr/local/bin` then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen. Now tell git to use `sublime`: `git config --global core.editor "sublime -n -w"` (the -n = new window; -w = wait for file to be closed before returning. If you don't use the latter option, Sublime doesn't actually let you _edit_ before returning to the in process `git rebase` or similar.) Et voila, from now on when you do a `rebase` or similar, it should open in Sublime Text. ## Sources - [Launch Sublime Text 2 from Mac OSX Terminal] - [Associating editors with git] - [Sublime Text OSX command line] [Launch Sublime Text 2 from Mac OSX Terminal]: https://gist.github.com/olivierlacan/1195304 [Associating editors with git]: https://help.github.com/articles/associating-text-editors-with-git/ [Sublime Text OSX command line]: http://www.sublimetext.com/docs/2/osx_command_line.html