6

Visual Studio 2015 has Git integration, but it picks up a .gitconfig file used in my Cygwin install that has some problems (for one thing, it is a symlink, but even it if was a normal file it would have wrong line endings). I would like to specify another location for it, but I am unable to find the correct setting.

There must be some Registry setting for this, as my Cygwin home dir is deeply hidden within some Chocolatey install.

2

Visual Studio finds the .gitconfig file using the %HOME% environment variable. By default its value is the same as %USERPROFILE%, but you can change it and create a new .gitconfig there to your liking.

Win button -> type "variables" -> select "Edit environment variables for your account"

If you don't have a %HOME% variable, you can create one for free on the same window.

You can't create files starting with a period through Explorer, but you can using any (decent) text editor, like Notepad++.

Alternatively, you can create a .gitconfig on the local repo itself, and options there will supersede the ones on your Cygwin install. However, you will have to do that for each repo.

| improve this answer | |
  • %HOME% doesn't exist on my Windows 7 system. If I try to create a file in %USERPROFILE% called ".gitconfig" it fails, telling me that filenames must not start with a period (.). – user74094 Sep 15 '17 at 15:26
  • I needed a restart in Windows for this to work – kurdtpage Jan 14 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.