0

If I go to the standard windows command prompt and type:

git config --global --edit

the window rerenders as some kind of editor (which I think is Bash but my background isn't *nix so I have no clue) with blue tildas in a column on the left and some filepaths at the bottom. e.g. x:/.gitconfig [unix] (16:25 29/09/2021) and the config entries at the top

e.g. 
[gui] 
recentrepo = x:/blah  

[user] 
email=...etc

(also not sure why the slashes are forward and not back slashes)

No amount of typing or hitting enter gets it to close or do anything. It won't save, it won't run, it won't close.

What is this editor window thingy and how can I use it?

adolf garlic
  • 3,034
  • 7
  • 39
  • 54
  • 2
    "*…blue tildas in a column on the left…*: This is [tag:vim]. See http://vimdoc.sourceforge.net/, esp. http://vimdoc.sourceforge.net/htmldoc/usr_01.html#tutor . See also https://stackoverflow.com/a/41356410/7976758 found in https://stackoverflow.com/search?q=%5Bgit%5D+%5Bvim%5D+%5Bwindows%5D+change+editor – phd Oct 05 '21 at 13:55
  • 1
    "*(also not sure why the slashes are forward and not back slashes)*" See https://stackoverflow.com/a/24985546/7976758 found in https://stackoverflow.com/search?q=%5Bgit%5D+config+backslashes – phd Oct 05 '21 at 14:37
  • 1
    You can choose the editor Git will launch by running this command: `git config --global core.editor notepad`, e.g., will use notepad. Replace `notepad` by any editor installed on your machine and available on your PATH. – joanis Oct 05 '21 at 15:22
  • 1
    I tested with VSCode and Notepad++ and that didn't work, though, because Git has to be able to monitor when the editor is done editing the file and closes it, and while that works with Vim and notepad, it seems not to work with all editors. But see https://stackoverflow.com/questions/30024353/how-to-use-visual-studio-code-as-default-editor-for-git for solving that. – joanis Oct 05 '21 at 15:30
  • 1
    @joanis https://stackoverflow.com/a/2486342/7976758 found in https://stackoverflow.com/search?q=%5Bgit%5D+notepad – phd Oct 05 '21 at 15:57
  • 1
    Note that bash is not an editor. The name `git-bash` just means *a port of bash to Windows*, needed because Git requires a POSIX-ish shell, and bash has always provided one, including when Windows didn't. vim itself is a pretty capable editor, and many people like it, but by the same token, many people hate it. :-) – torek Oct 05 '21 at 22:21

0 Answers0