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

后端 未结 10 1811
执念已碎
执念已碎 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:00

    git config --global core.editor /usr/bin/vim solved it for me.

    0 讨论(0)
  • 2020-12-13 07:02

    If your in vs code go to your source control tab on the left

    then type in your comment, press ctrl & enter

    if you do git status it should say nothing to commit, working tree clean..that means it worked

    0 讨论(0)
  • 2020-12-13 07:05

    Any file may be opened in any editor. So run "ps -ax|grep vim" to check which file is opened in which editor. And then run kill id-of-editor . For e.g. "kill 12345" Thats all

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题