-2

I used to use git commit --amend and it used to open a new tab in VS Code where I can edit the commit and when I close this tab the commit is changed, but for some reason this doesn't happen any more.

Now when I use git commit --amend it doesn't open the new tab and displays the commit message in the command line, and I can't edit it there.

How can I have the VS Code tab back, or edit the message in the command line?

I tried to edit the message in the command line but nothing changed, I can't even quit this phase with Ctrl + C and I exit it by closing Powershell.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 1
    How to edit the message in the command line will depend on what program is running there to edit it. Based on your difficulty quitting it, maybe [Vim](https://stackoverflow.com/q/11828270/3001761)? – jonrsharpe Apr 24 '23 at 08:02
  • https://stackoverflow.com/search?q=%5Bvisual-studio-code%5D+%5Bgit%5D+editor – phd Apr 24 '23 at 12:01

1 Answers1

1

I think your default editor is not VS code. Run this command:

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

The command will wait for the VS code file to be closed before returning to the command line.

Misha Zaslavsky
  • 8,414
  • 11
  • 70
  • 116