Best practices for cross platform git config?

前端 未结 3 1191
我在风中等你
我在风中等你 2020-12-04 06:34

Context

A number of my application user configuration files are kept in a git repository for easy sharing across multiple machines and multiple platforms. Amongst

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 07:22

    I think you should have the .gitconfig depend on the operating system the user is using. Windows users don't need autocrlf at all while Linux users do. E.g. save the text files with crlf and have Git convert the files automatically back and forth for the Linux users.

    You might also want to check .gitattributes, which allows you to define which files are converted and which are not. If you have the configuration files in just one place, you could define that the conversion is only done in that directory just to be on the safe side.

提交回复
热议问题