What is the syntax for specifying Windows paths in .gitconfig?

后端 未结 2 1803
温柔的废话
温柔的废话 2021-01-18 00:50

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:

[inc         


        
相关标签:
2条回答
  • 2021-01-18 00:54

    Ok, figured this out. The trick is:

    1. Surround in double-quotes
    2. Convert backslashes to forward slashes.
    3. Begin with drive letter + colon for absolute paths

    So the correct version of the above is:

    [include]
        path = "D:/Scott/Shared/config/common.gitconfig"
    
    0 讨论(0)
  • 2021-01-18 01:11

    Based on output of pwd in git bash, I would speculate it is probably

    /d/Scott/Shared/config/common.gitconfig
    
    0 讨论(0)
提交回复
热议问题