I am trying to set git on my Mac Os Snow Leopard 10.6.7 but I made some errors on doing that...
At this time I have the following warning:
$ git config --global core.editor
EDITOR=/usr/bin/vim
error: More than one value for the key core.editor: mate
$ git config --global core.editor open
warning: core.editor has multiple values
How can I solve that? And, mostly, how can I set the core.editor
to TextEdit and make it works?
P.S.: I already read this question.
To get this working for win7, open the .gitconfig file in c:/users/username/ folder and add the following line with --wait option outside the double quotes.
Hope its helpful to win7 users
For what it's worth, here's how I solved it:
1) Run in Terminal:
This adds a
subl
alias to/usr/local/bin/
pointing to Sublime Text 3 app’s binary file. Now runningsubl
in Terminal will launch Sublime Text 3 app.2) Run in Terminal:
This adds
editor = subl -n -w
to the[core]
section of the~/.gitconfig
file. Now runninggit commit
in Terminal will launch Sublime Text 3 app (subl
) in a new window (-n
), and the command line will wait (-w
) until the commit message is saved.Official Sublime Text 3 doc: http://www.sublimetext.com/docs/3/osx_command_line.html
The easiest way is to change the environment variable EDITOR to point to mate. In your
.bash_profile
add the following:and re-start your terminal session, or source the
.bash_profile
.As for your error message:
it means you've added multiple core.editor lines in your .gitconfig.
Use mate
~/.gitconfig
to modify your.gitconfig
and remove the extra lines, or if you don't mind unsetting all of them use:Then use
then you can leave
$EDITOR
set to what it was previously set to.If
mate
is not located in/usr/local/bin
find where it is first by usingtype mate
(in bash, not sure about other shells)Since you want to use
open
as your$GIT_EDITOR
you will need the following:This will work for that:
The following works for me:
Using Mac OSX 10.7.4 and Sublime Text 2 Build 2181
Note:
I have subl as an alias: