Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing a commit message with Atom Editor

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

I've done this in order to have atom as the editor, and git does indeed open atom when I do not add a commit message. My problem is that I don't know what to do next? I've tried writing a message on the first line, saving, and then closing, but it doesn't commit at all.

like image 549
Niveous Avatar asked Nov 04 '14 01:11

Niveous


People also ask

How do you add a commit to an atom?

Committing. Once you've staged some files, initiate a commit by hitting c . A new buffer will open for you to enter a commit message. When you're done describing your changes, cmd-alt-c will complete the commit.

How do I write a commit message in Vscode?

You can type a commit message above the changes and press Ctrl+Enter (macOS: ⌘+Enter) to commit them. If there are any staged changes, only those changes will be committed.


1 Answers

Update March 2016: issue 11053 has been fixed by DamienG, because:

Existing solution caused Command Prompt to exit and sleep command is not built in to Windows.
New solution works by spawning powershell child process that passes it's PID to atom and then waits indefinitely. When atom terminates that process the parent process continues.

Instead of waiting for Atom 1.7, one can immediately replace the atom.cmd by this one.


Update February 2016: issue 3074 just got closed with PR 9798:

This has been fixed and should be out in Atom 1.6.0.


Original answer (late 2014)

The --wait option does not work for now (Q4 2014, v0.141.0+) on Windows.

See issue 3074

atom --wait myfile.txt

Immediately terminates, but does continue to open the file. Expected result is to wait until the file is closed in the editor.

like image 62
VonC Avatar answered Oct 03 '22 20:10

VonC