Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Gary Ford14,475 Points
Sublime Text 2 as default editor in Git
How do I set up Sublime Text 2 as my default editor in Git?
Gary, could it be the fact that you have spaces in your path? Does it work if you instead type:
ln -s "/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Gary Ford14,475 Points
After attempting to set Sublime Text as my default using this command with no success:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
i decided to try nano following the instructions in notes for the video. I was able to create the README but then had trouble with the commit. Below is the code from the Terminal. Sorry it’s so long but I didn’t want to leave anything out. Hopefully I haven’t messed up things too much. I don’t know how to fix this. It seems there is a conflict between sublime and nano:
Macintosh-2:my_really_cool_project gfinchitown$ export EDITOR=nano Macintosh-2:my_really_cool_project gfinchitown$ nano README Macintosh-2:my_really_cool_project gfinchitown$ git add README Macintosh-2:my_really_cool_project gfinchitown$ git commit subl -n -w: subl: command not found error: There was a problem with the editor 'subl -n -w'. Please supply the message using either -m or -F option. Macintosh-2:my_really_cool_project gfinchitown$ git commit subl -n -w: subl: command not found error: There was a problem with the editor 'subl -n -w'. Please supply the message using either -m or -F option. Macintosh-2:my_really_cool_project gfinchitown$ git commit subl -n -w: subl: command not found error: There was a problem with the editor 'subl -n -w'. Please supply the message using either -m or -F option. Macintosh-2:my_really_cool_project gfinchitown$ git commit -m error: switch `m' requires a value usage: git commit [options] [--] <pathspec>...
-q, --quiet suppress summary after successful commit
-v, --verbose show diff in commit message template
Commit message options -F, --file <file> read message from file --author <author> override author for commit --date <date> override date for commit -m, --message <message> commit message -c, --reedit-message <commit> reuse and edit message from specified commit -C, --reuse-message <commit> reuse message from specified commit --fixup <commit> use autosquash formatted message to fixup specified commit --squash <commit> use autosquash formatted message to squash specified commit --reset-author the commit is authored by me now (used with -C/-c/--amend) -s, --signoff add Signed-off-by: -t, --template <file> use specified template file -e, --edit force edit of commit --cleanup <default> how to strip spaces and #comments from message --status include status in commit message template -S, --gpg-sign[=<key id>] GPG sign commit Macintosh-2:my_really_cool_project gfinchitown$
Any idea how to resolve this and get my system back to before I attempted to set up sublime as the default editor?
Gary Ford14,475 Points
Chris: I received and email from Tommy (the instructor) on how to reconfigure git to use nano, which I will try today. Per your earlier message, I agree with the frustration making you a better coder. Not about to give up now. lol Curious, what do you personally use to type commit messages? Thanks again for your help. It's much appreciated!
Alexandra Spalato11,478 Points
i use iterm, and have found the configuration here: http://devsnaps.herokuapp.com/blog/2013/11/09/setting-up-the-terminal-for-development-in-os-x there's a plugin to have sublime text, i config it yesterday, and as i really begin with console and git yesterday, if i did everybody can! for the theme terminal i have choosen ys. when all is install, to open a file with sublime type file_name subl (and not sublime) i've tryed to have sublime as default editor doing that: git config --global core.editor "subl -n -w" ... but don't work :-( so i i add nano as default : git config --global core.editor nano
Hope its helps!