Why does Git have a different configuration in Cygwin from Windows 7 Terminal?

I was under the impression that all Git config are in a text file in the directory .git

. It doesn't look like I added a core.editor

config parameter Cygwin

to tell Git in Cygwin which text editor to use when modifying or distributing:

git config --global core.editor "D:/homex/SFTWR/cygwin/bin/vi.exe"

      

I thought this would also take effect when using Git in a regular Windows 7 Terminal

(DOS-like CLI), which was OK because this executable vi

does indeed work on Windows outside of Cygwin.

But when I run

git config --list

      

in the terminal, the core.editor variable is not visible. Other. Thus, the configuration list in Cygwin shows 30 variables in the terminal as well. 29. I suppose that if the config was saved in some text file in the project's .git directory, it should be the same for every interface through which it is available.

My Git editor works in both interfaces, no problem. I'm just wondering how this thing works under the hood and why Cygwin and Terminal show different configurations.

+3


source to share


1 answer


Cygwin / Windows may be using two separate global .gitconfig

.

You can confirm which config file is in use by doing the following in both Cygwin and Windows Command Prompt and checking which files are open.

git config --global --edit

      



To fix this, you can delete the copy of .gitconfig in your Cygwin home directory and replace it with a hard link to the copy of .gitconfig in your Windows home directory. First delete the file, then open cmd as administrator and run:

mklink / H "C: \ cygwin64 \ home \ youruser \ .gitconfig" "C: \ Users \ youruser \ .gitconfig"

More on hard links can be found here: https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

+2


source







All Articles