2

If I do an interactive rebase using git rebase -i with the default editor configured for Git, everything works great.

If I add the following in my global .gitconfig...

[core]
editor = 'C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe'

...to configure VS Code as my default editor for git and then do git rebase -i, I get a launch VS Code during the interactive rebase, but it doesn't wait for me to edit the file. I see the git-rebase-todo file, then I see the commit hash get expanded to the full hash, then the pick line goes away, then the file is closed. Any idea how to tell VS Code to wait for me to edito the git-rebase-todo file before executing the rebase?

Jeremy Foster
  • 4,673
  • 3
  • 30
  • 49

1 Answers1

7

You must use the flag --wait when calling the vscode executable, e.g.

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

More details in the original answer.

Oleg
  • 24,465
  • 8
  • 61
  • 91
Philippe
  • 28,207
  • 6
  • 54
  • 78
  • Thanks!! I was going crazy as the interactive editor that allows to select options was just closing and leaving rebase running, now after 'Start Rebase' VS Code opens COMMIT_EDITMSG file. – AntrikshSharma Aug 06 '23 at 14:56