And the code management system that I used is Gerrit.
-
Do you have the editor mate installed? – Makoto Jul 06 '17 at 06:16
-
no, why should I install it? – Niubility Jul 06 '17 at 06:17
-
Considering that Git is explicitly expecting it to be installed on your machine...but then again that doesn't mean you *have* to install this specific editor. – Makoto Jul 06 '17 at 06:18
-
1Possible 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) – Makoto Jul 06 '17 at 06:18
-
@Makoto Not to be so serious, for I really haven't searched out that question... – Niubility Jul 06 '17 at 10:23
3 Answers
It seems that you've set your editor to mate
. Your shell does not find the command, because the editor is either not in your path or not installed.
You could set the editor to an editor of your choice (it's vim in the example) by running this command:
git config --global core.editor "vim"

- 2,126
- 3
- 22
- 30
Your $EDITOR
is set to mate -w
and, apparently, it can't be found at this time. Git tries to open your editor so that you can provide the commit message.
You can pass the message using -m
option, as is mentioned in the error message.
git commit --amend -a -m "my message"

- 226,338
- 43
- 373
- 367
Git expects a commit message description, through which you can explain what the code change is for etc. This helps other developers to understand your changes. Since you are using Gerrit, your code reviewers will know the reason for your changes easier.
Coming to the problem, For you it expects default editor to be "mate". Easier solution could be,
Pass the message as part git commit command itself.
Example: git commit -m "This commit is to fix problem XXXX"
Practical problems: If commit message is too long, this method is difficult. Better suited for smaller, single line commit messages.Update the GIT global configuration to the editor of your preference.
#git config --global core.editor "vi"
This will open "vi" editor through which you can add your commit message and save the same.
Additional info for understanding:
1. Commit message can be edited anytime using "git commit --amend" command.
2. All global configurations are stored in ".gitconfig" file, mostly in your HOME(~) directory. You can also edit and save the same.
Hope it helps.

- 11
- 2