How can I fix git commit error “Waiting for your editor to close the file…” with VS Code?

后端 未结 10 1831
执念已碎
执念已碎 2020-12-13 06:32

I\'m trying just git commit and Git is giving this message:

hint: Waiting for your editor to close the file... /c/Users/AGT/AppData/Loc

10条回答
  •  忘掉有多难
    2020-12-13 07:08

    It looks like it has to do with the path of VS Code in your case and possibly the command to set the editor git config --global core.editor "code --wait" not being correct.

    In my case, I couldn't complete a merging command.

    What really worked for me after ensuring that VS Code is correctly setup :

    code --version
    

    worked fine. Executing where code showed me that the installation of code was in a different location than the local app data, which was where git was looking in. I could also tell code could not really be found because the editor was not launching when I was merging.

    Finally executing

    git config --global core.editor 'code --wait'
    

    did the trick for me. Not that it's in single quotes as suggested further up in one of the comments.

提交回复
热议问题