I just started using git about a month ago. It was set up for me using TextMate as my default editor for commits. However, I'd like to switch the default to TextWrangler which I already have installed. I looked around online and found a line of code to type into the terminal to do this. So I opened the terminal and typed:
cd Desktop cd "projectName" git config --global core.editor TextWrangler git status git add. git commit //then the error comes up
The error says: error: cannot run TextWrangler: No such file or directory error: There was a problem with the editor 'TextWrangler'. Please supply the message using either -m or -F option.
I don't know what this means or what I am doing wrong. I am sure its an obvious mistake, but can anyone explain how to fix this?
The command to do this is git config --global core. editor "nano" . You can change the highlighted section with your editor of choice!
Changing the Git editor to Notepad++ Obviously, on an x64 machine, Notepad++ would be found under the Program Files (x86) directory. The bottom line is that when you run this command, make sure you provide the correct location of your text editor of choice.
Type :wq to save and exit the editor. Hit enter to return to the normal terminal window.
Just answered my own question with the help of the above comments... to switch to TextWrangler as the default for Git, you must open TextWrangler, click on TextWrangler in the tool bar and select "install command line tools" from the drop down. Then go into command line and type:
git config --global core.editor "edit -w"
Edit is the command that is understood in the command line which means to open a textWrangler file.
Follow-up to @thornomad
Command for changing editor in Git is (one of possibilities)
git config --global core.editor "mate -w"
, there string inside quotes marks is full command-line for invoking editor from terminal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With