0

So I am attending this course in udacity about version control with Git. My problem is that when I edit on a file and try to use Git commit, the editor (atom) will open but the message in the terminal will be “aborting commit due to empty commit message” I have tried adding "w", and "wait", and "-n -w" to the configuration line and even the added the path of atom but it did not work. Also, I deleted all duplicate lines in (.gitconfig) and yet no luck.

How to solve this problem?

Faisal
  • 1
  • 2
  • 2
    Can you post the output of `git config -l` as a code block? – bk2204 Jul 25 '20 at 16:11
  • 2
    The [GitHub docs](https://docs.github.com/en/github/using-git/associating-text-editors-with-git#using-atom-as-your-editor-2) say to use `git config --global core.editor "atom --wait"`. Note that it's `--wait`, not just `wait`. Is that what you tried? – wjandrea Jul 25 '20 at 17:40
  • https://stackoverflow.com/search?q=%5Batom-editor%5D+%5Bgit%5D+aborting+commit+due+to+empty+commit+message – phd Jul 26 '20 at 10:00

1 Answers1

0

If the Atom editor opens, then the path to atom isn’t the issue, since the command was found.

Rather, the arguments to the program must be incorrect since the command is immediately returning before you’ve finished editing the file. For the Atom editor, you need to use --wait to make the command wait until you’ve finished editing the file. GitHub have an example config value for core.editor for Atom:

git config --global core.editor "atom --wait"
grg
  • 5,023
  • 3
  • 34
  • 50
  • I tried this and it did not work – Faisal Jul 30 '20 at 05:05
  • Clean your current config by running "git config --global --unset-all core.editor [editor]" and then try to run it again "git config --global core.editor "[editor] --wait"" –  May 14 '22 at 17:28