I have launched the command git global --edit
Not sure how and why that works for you. That should not have worked in the first place.
To edit the config globally in editor, you should use below command :
git config --global --edit
This should open a text editor, make your changes ,save and exit the editor. That should work.
If you don't want to use the command and still want to be able to edit the git config, then locate the .gitconfig
file in your home directory $HOME/.gitconfig
.
NOTE: You can also change the default editor that git commands open up by executing below command in your git bash :
git config --global core.editor "<editor-name> --wait"
Replace <editor-name>
with the editor of your choice which is currently installed on your system. For VS code , the command would be :
git config --global core.editor "code --wait"