-1

To do a git commit with my own editor (Visual Code)

I needed to setup the editor like this:

git config --global --replace-all core.editor "code -w"

I was searching for this a long time and found out the -w was missing after code.

Without StackOverflow I would probably never know this. Can you explain me a little bit how I can solve such problem. In git config --help or the documentation of git I coulnd't find anything about the -w at the end.

Where did people on StackOverflow found about this?

A.H.
  • 63,967
  • 15
  • 92
  • 126

2 Answers2

1

The -w is a parameter to VS Code, so you'll not find it in git's help. You could have found it using code --help or online here

Siddhesh Rane
  • 419
  • 3
  • 7
1

The issue here is that this -w param is not one from Git but from VS Code. You can find documentation about it there: https://code.visualstudio.com/docs/editor/command-line

How you could have understood that? If you look at the command, the -w is inside the "" block so it means it is part of the command you pass to the Git config, so a parameter of the VS Code command line tool.

lapostoj
  • 113
  • 1
  • 1
  • 8