Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which .gitconfig file does Visual Studio use?

In Visual Studio Enterprise 2017 15.2 (26430.15) Release, when I push a simple test edit of my cloned public Github repository, it fails; with an error message concerning an AggregateException, and an inability to spawn "askpass". Other SO posts relating to that issue don't work for me.

I'd like to try adding our http/https proxy settings manually to the .gitconfig file used by VS2017, but I can't find it. I have one already under cygwin, but I'm not sure if using that is a good idea - nor how to ask VS2017 to use it. (I also have Git Bash etc. already installed.)

like image 592
user2023370 Avatar asked Dec 03 '22 12:12

user2023370


2 Answers

In case anyone else stumbles upon this issue, VS2017 and VS2019 does indeed use it's own instance of Git with it's own .gitconfig, at least if you're on the TFS platform.

These files are usually located here:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\etc

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\etc

If you want to check which path is searched when VS is looking for Git, go to:

Tools -> Options -> Projects and Solutions -> Web Package Management -> External Web Tools

It's useful to know if you want to change which Git installation is being used.

like image 115
Scopperloit Avatar answered Dec 11 '22 15:12

Scopperloit


VS2017 has no Visual Studio specific .gitconfig.

You can alter the standard global git config file, or the local one for the repository in question.

To edit the global one:

git config --global --edit

To edit the repository local one

git config --edit
like image 32
Klas Mellbourn Avatar answered Dec 11 '22 16:12

Klas Mellbourn