I'm trying to use the include.path
config described here, but I can't seem to find the correct path syntax on Windows.
My current .gitconfig:
[include]
path = 'D:\Scott\Shared\config\common.gitconfig'
But git complains: fatal: bad config file line 2 in C:\Users\Scott/.gitconfig
What's the proper way to escape paths for Windows? Note: I'm using git from Powershell and not git bash.
The system level configuration file lives in a gitconfig file off the system root path. $(prefix)/etc/gitconfig on unix systems. On windows this file can be found at C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, and in C:\ProgramData\Git\config on Windows Vista and newer.
git config --global --edit should tell you the exact location no matter what kind of setup you have--just look at what file comes up in your editor. git config --global --list was also useful for when it doesn't exist as it gave the location of where git is expecting it to be.
Ok, figured this out. The trick is:
So the correct version of the above is:
[include]
path = "D:/Scott/Shared/config/common.gitconfig"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With