gitvisual-studio-code

How to fix VS Code getting stuck after commit without message?


I frequently forgot to type a message before hitting the COMMIT button.

After that, VSCode seems to be stuck in the "committing" process with no obvious way to cancel.

What I am doing as a workaround is reopening the VSCode window.

How to do it better?


Solution

  • If you hit "Commit" without a commit message, VSCode opens a new editor tab with the file COMMIT_EDITMSG and waits for you to type a message and either save and close the file or click Accept Commit Message in the editor toolbar (a checkmark).

    Otherwise

    If that's not happening on your end, try reading the log to get more details:

    1. Stage changes
    2. Run Git: Show Git Output (git.showOutput)
    3. Click "Clear Output"
    4. Click "Commit"
    5. See what the log says (in the Output pane)

    If I try this on my end, I get two entries:

    1. timestamp [info] > git rev-parse --show-toplevel [2ms]
    2. timestamp [info] fatal: this operation must be run in a work tree

    I'm not sure why, but at least you know if you see that, it's not out of the ordinary.