0

I have a problem when committing a file with atom text editor

I've used in Git Bash

git config --global core.editor "atom --wait"

but when committing a file like this:

git commit

This error show up:

hint: Waiting for your editor to close the file... 'C:\Users\SALAH' is not recognized as an internal or external command, operable program or batch file.

Aborting commit due to empty commit message.

enter image description here


but when using sublime text as my text editor like this: git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -n -w"

the commitment works perfectly

it is a problem with atom or something about the PATH...


any suggestions I will be thankful

Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Salah Eddine
  • 155
  • 2
  • 12

3 Answers3

1

I also had the similar issue then I figured out that I have a space in my username between two words.

Git directs to the path but stops right before the space in username ('C:\Users\SALAH') and throws the following error -

hint: Waiting for your editor to close the file... 'C:\Users\SALAH' is not 
recognized as an internal or external command,
operable program or batch file.

Aborting commit due to empty commit message.

Solution = Change your username to one word or without spaces. You can follow this particular video to change your username without reinstalling windows.

https://www.youtube.com/watch?v=J_rTOA4gXJI

0

In the line;

git config --global core.editor "atom --wait"

Replace "atom" with the direct path to the atom application. Surround the path with single quotes.

Eg;

git config --global core.editor "'C:\Users\name\AppData\Local\atom\app-1.53.0\atom.exe' --wait"
0

You need to use the real path of atom.exe.

My command looked like this:

$ git config --global core.editor "C:/Users/name/AppData/Local/atom/atom.exe"

It worked for me. You can also give it a try.

Good luck!

Laurent
  • 12,287
  • 7
  • 21
  • 37
Dismas
  • 377
  • 1
  • 3
  • 10