I'm running git commit --amend
in the VSCode terminal and it pops up the commit message as a file in the VSCode editor window, and git says (in the terminal) hint: Waiting for your editor to close the file...
but doesn't give input back yet.
I amend my changes, then save and close the file. Then git just sits there in the terminal like it didn't know the editor window closed. Does VSCode cling onto the file handle longer than it needs to?
It looks like it's not a path issue because I can start and finish the commit amend (note I'm using keyboard shortcuts to do my initial commits, so that doesn't open an editor - I only noticed this on an amend).
For closing the “vi” Git commit editor, type the “:wq” command, where “:” helps to enter in the command mode because “vi” is a mode-based editor, “w” is for writing and saving the added commit, and “q” is to exit. Press the “Enter” key after specifying the mentioned command.
The git commit command captures a snapshot of the project's currently staged changes. Committed snapshots can be thought of as “safe” versions of a project—Git will never change them unless you explicitly ask it to.
Alternatively use a -m "your commit comment" argument do directly give the commit message and avoid git opening an editor.
I see a similar issue here on Github.
If you use editor = code --wait
in .gitconfig
, you have to close VS Code (not the .git/COMMIT_EDITMSG
file) to correctly commit.
Add editor = code --wait -n
in your .gitconfig
file. I think -n
here means a new instance of VS Code.
After finishing the config, you type git commit
in VS Code terminal, a new VS Code windows will pop up. Just edit your message in COMMIT_EDITMSG
in the new windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With