Fix “There was a problem with the editor ‘vi’” on Mac

Share Button

I encountered this issue when I run

and vi opens up. If I input some comment, save and quit. I’ll get this error msg:

and commit will fail.

I think this is because some thing wrong with default vi installed on Mac. I verified by running

This means quit vi returns error code 1. I have no idea why this happen. But I tried with Vim and it doesn’t happen. So the solution is really simple, set default edit to something other than this problematic vi.

To find which vim you are using: