1

A few days ago I tried to configure Sublime Text 3 so that it would open when I did commit in git, but an error always comes out, and when I try to put back the vim I get this:

MacBook-Air-de-Andres:bin andr3yvlz$ git config --global core.editor vim
warning: core.editor has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --replace-all to change core.editor.

i try to do this too:

MacBook-Air-de-Andres:bin andr3yvlz$ git config --replace-all core.editor vim
fatal: not in a git directory
MacBook-Air-de-Andres:bin andr3yvlz$ 

The commit error is:

MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$ git add .
MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$ git commit
hint: Waiting for your editor to close the file... 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.
MacBook-Air-de-Andres:Andr3yvlz andr3yvlz$ 

if someone knows how to configure the sublime with git, it would be very helpful, and thanks in advance

Andrés Vélez
  • 113
  • 1
  • 6
  • You can change it with `git config --global --replace-all` (supply two options together). – iBug Feb 08 '19 at 15:27
  • 1
    Possible duplicate of [How do I make Git use the editor of my choice for commits?](https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits) – matt Feb 08 '19 at 15:27
  • I'd recommend opening up your user profile's `.gitconfig` file to see where you have the duplicates of `core.editor` and possibly make adjustments there (though it's recommended to make changes with the git commands). You should be able to find it here on a Mac: `~/.gitconfig` – Joseph Feb 08 '19 at 15:29

1 Answers1

2

You can try to remove the option code.editor from ~/.gitconfig and than add it.

$ git config --global --unset-all core.editor
$ git config --global core.editor "vim"
iBug
  • 35,554
  • 7
  • 89
  • 134
Druta Ruslan
  • 7,171
  • 2
  • 28
  • 38